"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cloudkitty/tests/test_orchestrator.py" between
cloudkitty-16.0.0.tar.gz and cloudkitty-17.0.0.tar.gz

About: OpenStack CloudKitty provides Rating-as-a-Service for OpenStack.
The "Zed" series (latest release).

test_orchestrator.py  (cloudkitty-16.0.0):test_orchestrator.py  (cloudkitty-17.0.0)
skipping to change at line 543 skipping to change at line 543
def test_collect_no_data(self): def test_collect_no_data(self):
metric = "metric1" metric = "metric1"
timestamp_now = tzutils.localized_now() timestamp_now = tzutils.localized_now()
self.collector_mock.retrieve.return_value = (metric, None) self.collector_mock.retrieve.return_value = (metric, None)
expected_message = "Collector 'toString' returned no data for " \ expected_message = "Collector 'toString' returned no data for " \
"resource 'metric1'" "resource 'metric1'"
expected_message = re.escape(expected_message) expected_message = re.escape(expected_message)
self.assertRaisesRegexp( self.assertRaisesRegex(
collector.NoDataCollected, expected_message, self.worker._collect, collector.NoDataCollected, expected_message, self.worker._collect,
metric, timestamp_now) metric, timestamp_now)
next_timestamp = tzutils.add_delta( next_timestamp = tzutils.add_delta(
timestamp_now, datetime.timedelta(seconds=self.worker._period)) timestamp_now, datetime.timedelta(seconds=self.worker._period))
self.collector_mock.retrieve.assert_has_calls([ self.collector_mock.retrieve.assert_has_calls([
mock.call(metric, timestamp_now, next_timestamp, mock.call(metric, timestamp_now, next_timestamp,
self.worker._tenant_id)]) self.worker._tenant_id)])
skipping to change at line 917 skipping to change at line 917
self.collector_mock, self.storage_mock, self.scope_mock, self.collector_mock, self.storage_mock, self.scope_mock,
self.worker_id) self.worker_id)
def test_load_scope_key_scope_not_found(self): def test_load_scope_key_scope_not_found(self):
self.state_manager_get_all_mock.return_value = [] self.state_manager_get_all_mock.return_value = []
expected_message = "Scope [toStringMock] scheduled for reprocessing " \ expected_message = "Scope [toStringMock] scheduled for reprocessing " \
"does not seem to exist anymore." "does not seem to exist anymore."
expected_message = re.escape(expected_message) expected_message = re.escape(expected_message)
self.assertRaisesRegexp(Exception, expected_message, self.assertRaisesRegex(Exception, expected_message,
self.reprocessing_worker.load_scope_key) self.reprocessing_worker.load_scope_key)
self.state_manager_get_all_mock.assert_has_calls([ self.state_manager_get_all_mock.assert_has_calls([
mock.call(self.reprocessing_worker._tenant_id)]) mock.call(self.reprocessing_worker._tenant_id)])
def test_load_scope_key_more_than_one_scope_found(self): def test_load_scope_key_more_than_one_scope_found(self):
self.state_manager_get_all_mock.return_value = [ self.state_manager_get_all_mock.return_value = [
self.scope_mock, self.scope_mock] self.scope_mock, self.scope_mock]
expected_message = "Unexpected number of storage state entries " \ expected_message = "Unexpected number of storage state entries " \
"found for scope [toStringMock]." "found for scope [toStringMock]."
expected_message = re.escape(expected_message) expected_message = re.escape(expected_message)
self.assertRaisesRegexp(Exception, expected_message, self.assertRaisesRegex(Exception, expected_message,
self.reprocessing_worker.load_scope_key) self.reprocessing_worker.load_scope_key)
self.state_manager_get_all_mock.assert_has_calls([ self.state_manager_get_all_mock.assert_has_calls([
mock.call(self.reprocessing_worker._tenant_id)]) mock.call(self.reprocessing_worker._tenant_id)])
def test_load_scope_key(self): def test_load_scope_key(self):
self.reprocessing_worker.load_scope_key() self.reprocessing_worker.load_scope_key()
self.state_manager_get_all_mock.assert_has_calls([ self.state_manager_get_all_mock.assert_has_calls([
mock.call(self.reprocessing_worker._tenant_id)]) mock.call(self.reprocessing_worker._tenant_id)])
 End of changes. 3 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)