Пример #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)
Пример #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)
Пример #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('')
Пример #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('')