Exemple #1
0
    def test_missing_service_uid(self):
        self.data['service']['uid'] = None
        errors = validate_vip_event_data(self.data)
        self.assertEqual(len(errors), 1)
        self.assertIn('missing service UID', errors)

        self.data['service'] = None
        errors = validate_vip_event_data(self.data)
        self.assertEqual(len(errors), 1)
        self.assertIn('missing service UID', errors)
Exemple #2
0
    def test_invalid_ip_address(self):
        self.data['ip'] = '10.20.30.40.50'
        errors = validate_vip_event_data(self.data)
        self.assertEqual(len(errors), 1)
        self.assertIn('invalid IP address "10.20.30.40.50"', errors)

        self.data['ip'] = None
        errors = validate_vip_event_data(self.data)
        self.assertEqual(len(errors), 1)
        self.assertIn('invalid IP address "None"', errors)
Exemple #3
0
    def test_invalid_port(self):
        self.data['port'] = 65536
        errors = validate_vip_event_data(self.data)
        self.assertEqual(len(errors), 1)
        self.assertIn('invalid port "65536"', errors)

        self.data['port'] = -1
        errors = validate_vip_event_data(self.data)
        self.assertEqual(len(errors), 1)
        self.assertIn('invalid port "-1"', errors)

        self.data['port'] = None
        errors = validate_vip_event_data(self.data)
        self.assertEqual(len(errors), 1)
        self.assertIn('invalid port "None"', errors)
Exemple #4
0
 def test_if_errors_aggregate(self):
     self.data['service'] = None
     self.data['environment'] = None
     errors = validate_vip_event_data(self.data)
     self.assertEqual(len(errors), 2)
     self.assertIn('missing service UID', errors)
     self.assertIn('missing environment', errors)
Exemple #5
0
 def test_missing_environment(self):
     self.data['environment'] = None
     errors = validate_vip_event_data(self.data)
     self.assertEqual(len(errors), 1)
     self.assertIn('missing environment', errors)
Exemple #6
0
 def test_missing_protocol(self):
     self.data['protocol'] = None
     errors = validate_vip_event_data(self.data)
     self.assertEqual(len(errors), 1)
     self.assertIn('missing protocol', errors)
Exemple #7
0
 def test_missing_name(self):
     self.data['name'] = None
     errors = validate_vip_event_data(self.data)
     self.assertEqual(len(errors), 1)
     self.assertIn('missing name', errors)