def test_empty_metrics(self): """ Rejects configuration file with empty metrics attribute. """ self.config['metrics'] = {} with self.assertRaises(ValidationError): validate_configuration(self.config)
def test_missing_metrics(self): """ Rejects configuration file with missing metrics attribute. """ del self.config['metrics'] with self.assertRaises(ValidationError): validate_configuration(self.config)
def test_empty_scenarios(self): """ Rejects configuration file with empty scenarios attribute. """ self.config['scenarios'] = {} with self.assertRaises(ValidationError): validate_configuration(self.config)
def test_missing_scenarios(self): """ Rejects configuration file with missing scenarios attribute. """ del self.config['scenarios'] with self.assertRaises(ValidationError): validate_configuration(self.config)
def test_multiple_metrics(self): """ Accepts configuration file with multiple metrics. """ self.config['metrics'].append({ 'name': 'another', 'type': 'another' }) validate_configuration(self.config)
def test_multiple_scenarios(self): """ Accepts configuration file with multiple scenarios. """ self.config['scenarios'].append({ 'name': 'another', 'type': 'another' }) validate_configuration(self.config)
def test_multiple_operations(self): """ Accepts configuration file with multiple operations. """ self.config['operations'].append({ 'name': 'another', 'type': 'another' }) validate_configuration(self.config)
def test_multiple_scenarios(self): """ Accepts configuration file with multiple scenarios. """ self.config['scenarios'].append({'name': 'another', 'type': 'another'}) validate_configuration(self.config)
def test_metric_extra_attribute(self): """ Accepts configuration file with extra attributes on metrics. """ self.config['metrics'][0]['extras'] = 3 validate_configuration(self.config)
def test_operation_extra_attribute(self): """ Accepts configuration file with extra attributes on operations. """ self.config['operations'][0]['extras'] = 3 validate_configuration(self.config)
def test_scenario_extra_attribute(self): """ Accepts configuration file with extra attributes on scenario. """ self.config['scenarios'][0]['extras'] = 3 validate_configuration(self.config)
def test_config_extra_attribute(self): """ Accepts configuration file with extra attributes. """ self.config['extras'] = 3 validate_configuration(self.config)
def test_valid(self): """ Accepts configuration file with valid entries. """ validate_configuration(self.config)