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)
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('')