Ejemplo n.º 1
0
 def test_make_network_id(self):
     """
     Ensures that an input public key is hashed in the right way.
     """
     result = make_network_id(PUBLIC_KEY)
     expected = sha512(PUBLIC_KEY.encode('ascii')).hexdigest()
     self.assertEqual(expected, result)
Ejemplo n.º 2
0
 def test_make_network_id(self):
     """
     Ensures that an input public key is hashed in the right way.
     """
     result = make_network_id(PUBLIC_KEY)
     expected = sha512(PUBLIC_KEY.encode('ascii')).hexdigest()
     self.assertEqual(expected, result)
Ejemplo n.º 3
0
 def test_make_network_id_with_blank_key(self):
     """
     If the public key is empty ensure a ValueError is raised.
     """
     with self.assertRaises(ValueError):
         make_network_id('')
Ejemplo n.º 4
0
 def test_make_network_id_with_blank_key(self):
     """
     If the public key is empty ensure a ValueError is raised.
     """
     with self.assertRaises(ValueError):
         make_network_id('')