"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cloudkitty/tests/collectors/test_validation.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_validation.py  (cloudkitty-16.0.0):test_validation.py  (cloudkitty-17.0.0)
skipping to change at line 190 skipping to change at line 190
expected_output, expected_output,
) )
def test_check_duplicates(self): def test_check_duplicates(self):
data = copy.deepcopy(self.base_data) data = copy.deepcopy(self.base_data)
for metric_name, metric in data['metrics'].items(): for metric_name, metric in data['metrics'].items():
metric['metadata'].append('one') metric['metadata'].append('one')
self.assertRaises( self.assertRaises(
collector.InvalidConfiguration, collector.InvalidConfiguration,
collector.check_duplicates, metric_name, metric) collector.check_duplicates, metric_name, metric)
def test_validate_map_mutator(self):
data = copy.deepcopy(self.base_data)
# Check that validation succeeds when MAP mutator is not used
for metric_name, metric in data['metrics'].items():
collector.validate_map_mutator(metric_name, metric)
# Check that validation raises an exception when mutate_map is missing
for metric_name, metric in data['metrics'].items():
metric['mutate'] = 'MAP'
self.assertRaises(
collector.InvalidConfiguration,
collector.validate_map_mutator, metric_name, metric)
data = copy.deepcopy(self.base_data)
# Check that validation raises an exception when mutate_map is present
# but MAP mutator is not used
for metric_name, metric in data['metrics'].items():
metric['mutate_map'] = {}
self.assertRaises(
collector.InvalidConfiguration,
collector.validate_map_mutator, metric_name, metric)
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added

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