Commit eabd7e10 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: More fixes

parent 56136733
Pipeline #19298 failed with stage
in 0 seconds
......@@ -239,9 +239,12 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
def test_no_data(self):
instance = self._makeInstance()
news_dict = instance.SoftwareInstance_getNewsDict()
expected_news_dict = {'no_data': 1,
'text': '#error no data found for %s' % instance.getReference(),
'user': 'SlapOS Master'}
expected_news_dict = {'created_at': self.created_at,
'no_data': 1,
'since': self.created_at,
'state': '',
'text': '#error no data found for %s' % instance.getReference(),
'user': 'SlapOS Master'}
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -338,9 +341,12 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
def test_no_data(self):
installation = self._makeSoftwareInstallation()
news_dict = installation.SoftwareInstallation_getNewsDict()
expected_news_dict = {'no_data': 1,
'text': '#error no data found for %s' % installation.getReference(),
'user': 'SlapOS Master'}
expected_news_dict = {'created_at': self.created_at,
'no_data': 1,
'since': self.created_at,
'state': '',
'text': '#error no data found for %s' % installation.getReference(),
'user': 'SlapOS Master'}
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -411,9 +417,12 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
compute_node = self._makeComputeNode()
news_dict = compute_node.ComputeNode_getNewsDict()
expected_news_dict = {'compute_node':
{'no_data': 1,
{'created_at': self.created_at,
'no_data': 1,
'since': self.created_at,
'state': '',
'text': '#error no data found for %s' % compute_node.getReference(),
'user': 'SlapOS Master'},
'user': 'SlapOS Master'},
'partition': {}
}
self.assertEqual(news_dict, expected_news_dict)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment