Exemplo n.º 1
0
 def test_validate_node(self):
     """
     A list containing id and IP address strings, a port integer and
     version string passes.
     """
     self.assertTrue(validate_node(['id', '0.1',
                                   'http://192.168.0.1:9999/']))
Exemplo n.º 2
0
 def test_validate_node_bad_id(self):
     """
     The node's id should be a string.
     """
     self.assertFalse(validate_node([123, '0.1',
                                    'http://192.168.0.1:9999/']))
Exemplo n.º 3
0
 def test_validate_node_wrong_type(self):
     """
     The node should be expressed within a list.
     """
     self.assertFalse(validate_node(('id', '0.1',
                                    'http://192.168.0.1:9999/')))
Exemplo n.º 4
0
 def test_validate_node_bad_uri(self):
     """
     The URI should be a string.
     """
     self.assertFalse(validate_node(['id', '0.1',
                                    ['http://192.168.0.1:9999/']]))
Exemplo n.º 5
0
 def test_validate_node_invalid_version(self):
     """
     The version number should be a string.
     """
     self.assertFalse(validate_node(['id', 0.1,
                                    'http://192.168.0.1:9999/']))