示例#1
0
 def test_empty_metrics(self):
     """
     Rejects configuration file with empty metrics attribute.
     """
     self.config['metrics'] = {}
     with self.assertRaises(ValidationError):
         validate_configuration(self.config)
示例#2
0
 def test_missing_metrics(self):
     """
     Rejects configuration file with missing metrics attribute.
     """
     del self.config['metrics']
     with self.assertRaises(ValidationError):
         validate_configuration(self.config)
示例#3
0
 def test_empty_scenarios(self):
     """
     Rejects configuration file with empty scenarios attribute.
     """
     self.config['scenarios'] = {}
     with self.assertRaises(ValidationError):
         validate_configuration(self.config)
示例#4
0
 def test_missing_scenarios(self):
     """
     Rejects configuration file with missing scenarios attribute.
     """
     del self.config['scenarios']
     with self.assertRaises(ValidationError):
         validate_configuration(self.config)
示例#5
0
 def test_multiple_metrics(self):
     """
     Accepts configuration file with multiple metrics.
     """
     self.config['metrics'].append({
         'name': 'another',
         'type': 'another'
     })
     validate_configuration(self.config)
示例#6
0
 def test_multiple_scenarios(self):
     """
     Accepts configuration file with multiple scenarios.
     """
     self.config['scenarios'].append({
         'name': 'another',
         'type': 'another'
     })
     validate_configuration(self.config)
示例#7
0
 def test_multiple_operations(self):
     """
     Accepts configuration file with multiple operations.
     """
     self.config['operations'].append({
         'name': 'another',
         'type': 'another'
     })
     validate_configuration(self.config)
示例#8
0
 def test_multiple_scenarios(self):
     """
     Accepts configuration file with multiple scenarios.
     """
     self.config['scenarios'].append({'name': 'another', 'type': 'another'})
     validate_configuration(self.config)
示例#9
0
 def test_metric_extra_attribute(self):
     """
     Accepts configuration file with extra attributes on metrics.
     """
     self.config['metrics'][0]['extras'] = 3
     validate_configuration(self.config)
示例#10
0
 def test_operation_extra_attribute(self):
     """
     Accepts configuration file with extra attributes on operations.
     """
     self.config['operations'][0]['extras'] = 3
     validate_configuration(self.config)
示例#11
0
 def test_scenario_extra_attribute(self):
     """
     Accepts configuration file with extra attributes on scenario.
     """
     self.config['scenarios'][0]['extras'] = 3
     validate_configuration(self.config)
示例#12
0
 def test_config_extra_attribute(self):
     """
     Accepts configuration file with extra attributes.
     """
     self.config['extras'] = 3
     validate_configuration(self.config)
示例#13
0
 def test_valid(self):
     """
     Accepts configuration file with valid entries.
     """
     validate_configuration(self.config)
示例#14
0
 def test_valid(self):
     """
     Accepts configuration file with valid entries.
     """
     validate_configuration(self.config)
示例#15
0
 def test_metric_extra_attribute(self):
     """
     Accepts configuration file with extra attributes on metrics.
     """
     self.config['metrics'][0]['extras'] = 3
     validate_configuration(self.config)
示例#16
0
 def test_operation_extra_attribute(self):
     """
     Accepts configuration file with extra attributes on operations.
     """
     self.config['operations'][0]['extras'] = 3
     validate_configuration(self.config)
示例#17
0
 def test_scenario_extra_attribute(self):
     """
     Accepts configuration file with extra attributes on scenario.
     """
     self.config['scenarios'][0]['extras'] = 3
     validate_configuration(self.config)
示例#18
0
 def test_config_extra_attribute(self):
     """
     Accepts configuration file with extra attributes.
     """
     self.config['extras'] = 3
     validate_configuration(self.config)