@@ -470,9 +470,7 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
...
@@ -470,9 +470,7 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
compute_node=self._makeComputeNode()
compute_node=self._makeComputeNode()
self._logFakeAccess(compute_node)
self._logFakeAccess(compute_node)
news_dict=compute_node.ComputeNode_getNewsDict()
news_dict=compute_node.ComputeNode_getNewsDict()
monitor_url='https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:%s'%(compute_node.getReference())
expected_news_dict={'created_at':self.created_at,
expected_news_dict={'compute_node':
{'created_at':self.created_at,
'no_data_since_15_minutes':0,
'no_data_since_15_minutes':0,
'no_data_since_5_minutes':0,
'no_data_since_5_minutes':0,
'portal_type':compute_node.getPortalType(),
'portal_type':compute_node.getPortalType(),
...
@@ -480,12 +478,7 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
...
@@ -480,12 +478,7 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
'since':self.created_at,
'since':self.created_at,
'state':'start_requested',
'state':'start_requested',
'text':'#access OK',
'text':'#access OK',
'user':'SlapOS Master'},
'user':'SlapOS Master'}
'partition':{},
'portal_type':compute_node.getPortalType(),
'reference':compute_node.getReference(),
'monitor_url':monitor_url
}
self.assertEqual(_decode_with_json(news_dict),
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
_decode_with_json(expected_news_dict))
self.tic()
self.tic()
...
@@ -500,10 +493,8 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
...
@@ -500,10 +493,8 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
monitor_url='https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:%s'%(compute_node.getReference())
expected_news_dict={'compute_node':
expected_news_dict={'created_at':self.created_at,
{'created_at':self.created_at,
'no_data_since_15_minutes':0,
'no_data_since_15_minutes':0,
'no_data_since_5_minutes':0,
'no_data_since_5_minutes':0,
'portal_type':compute_node.getPortalType(),
'portal_type':compute_node.getPortalType(),
...
@@ -511,11 +502,7 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
...
@@ -511,11 +502,7 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
'since':self.created_at,
'since':self.created_at,
'state':'stop_requested',
'state':'stop_requested',
'text':'#access OK',
'text':'#access OK',
'user':'SlapOS Master'},
'user':'SlapOS Master'
'partition':{},
'portal_type':compute_node.getPortalType(),
'reference':compute_node.getReference(),
'monitor_url':monitor_url
}
}
self.assertEqual(_decode_with_json(news_dict),
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
_decode_with_json(expected_news_dict))
...
@@ -531,10 +518,8 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
...
@@ -531,10 +518,8 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
monitor_url='https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:%s'%(compute_node.getReference())
expected_news_dict={'compute_node':
expected_news_dict={'created_at':self.created_at,
{'created_at':self.created_at,
'no_data_since_15_minutes':0,
'no_data_since_15_minutes':0,
'no_data_since_5_minutes':0,
'no_data_since_5_minutes':0,
'portal_type':compute_node.getPortalType(),
'portal_type':compute_node.getPortalType(),
...
@@ -542,11 +527,7 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
...
@@ -542,11 +527,7 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
'since':self.created_at,
'since':self.created_at,
'state':'destroy_requested',
'state':'destroy_requested',
'text':'#access OK',
'text':'#access OK',
'user':'SlapOS Master'},
'user':'SlapOS Master'
'partition':{},
'portal_type':compute_node.getPortalType(),
'reference':compute_node.getReference(),
'monitor_url':monitor_url
}
}
self.assertEqual(_decode_with_json(news_dict),
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
_decode_with_json(expected_news_dict))
...
@@ -559,20 +540,14 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
...
@@ -559,20 +540,14 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
deftest_no_data(self):
deftest_no_data(self):
compute_node=self._makeComputeNode()
compute_node=self._makeComputeNode()
news_dict=compute_node.ComputeNode_getNewsDict()
news_dict=compute_node.ComputeNode_getNewsDict()
monitor_url='https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:%s'%(compute_node.getReference())
expected_news_dict={'created_at':self.created_at,
expected_news_dict={'compute_node':
{'created_at':self.created_at,
'no_data':1,
'no_data':1,
'portal_type':compute_node.getPortalType(),
'portal_type':compute_node.getPortalType(),
'reference':compute_node.getReference(),
'reference':compute_node.getReference(),
'since':self.created_at,
'since':self.created_at,
'state':'',
'state':'',
'text':'#error no data found for %s'%compute_node.getReference(),
'text':'#error no data found for %s'%compute_node.getReference(),
'user':'SlapOS Master'},
'user':'SlapOS Master'
'partition':{},
'portal_type':compute_node.getPortalType(),
'reference':compute_node.getReference(),
'monitor_url':monitor_url
}
}
self.assertEqual(_decode_with_json(news_dict),
self.assertEqual(_decode_with_json(news_dict),
_decode_with_json(expected_news_dict))
_decode_with_json(expected_news_dict))
...
@@ -586,13 +561,11 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
...
@@ -586,13 +561,11 @@ class TestComputeNode_getNewsDict(TestSlapOSHalJsonStyleMixin):
compute_node=self._makeComputeNode()
compute_node=self._makeComputeNode()
instance=self._makeInstance()
instance=self._makeInstance()
instance.setAggregateValue(self.partition0)
instance.setAggregateValue(self.partition0)
monitor_url='https://monitor.app.officejs.com/#/?page=ojsm_dispatch&query=portal_type:"Software Instance" AND aggregate_reference:%s'%(compute_node.getReference())