def test_signature_equal(self): # Sign the data citizen_card = CitizenCard(self.pin) data = "Hello World" signature = citizen_card.sign(data) is_valid = citizen_card.valid_signature(signature, data) citizen_card.signOut() self.assertTrue(is_valid, msg="Signature should be valid")
def test_signature_not_equal(self): # Sign the data citizen_card = CitizenCard(self.pin) data1 = "Hello World" signature = citizen_card.sign(data1) data2 = "Hello world, again" is_valid = citizen_card.valid_signature(signature, data2) citizen_card.signOut() self.assertFalse(is_valid, msg="Signature should be not valid")