def test_init(self): # Trival test creates a SignedObject # check that everything initalizes as expected temp = SignedObject({"TestSignatureDictKey": "test"}, "TestSignatureDictKey") self.assertEqual(temp.SignatureDictKey, "TestSignatureDictKey") self.assertEqual(temp.dump(), {"TestSignatureDictKey": "test", "PublicKey": None}) self.assertEqual(temp.__repr__(), temp.serialize()) self.assertIsNotNone(temp.Identifier) temp._identifier = None self.assertIsNotNone(temp.Identifier)
def test_init(self): # Trival test creates a SignedObject # check that everything initalizes as expected signkey = SigObj.generate_signing_key() temp = SignedObject({signkey: "test"}, signkey) self.assertEquals(temp.SignatureKey, signkey) self.assertEquals(temp.dump(), {signkey: "test", "public_key": None}) self.assertEquals(temp.__repr__(), temp.serialize()) self.assertIsNotNone(temp.Identifier) temp._identifier = None self.assertIsNotNone(temp.Identifier)