Skip to content

Commit

Permalink
explain why literal != is used in asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
tomato42 committed Feb 28, 2023
1 parent fd8b239 commit 4b51ae6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ecdsa/test_eddsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ def test_equal_public_points(self):
key2 = PublicKey(generator_ed25519, b"\x01" * 32)

self.assertEqual(key1, key2)
# verify that `__ne__` works as expected
self.assertFalse(key1 != key2)

def test_unequal_public_points(self):
Expand All @@ -519,20 +520,23 @@ def test_unequal_publickey_curves(self):
key2 = PublicKey(generator_ed448, b"\x03" * 56 + b"\x00")

self.assertNotEqual(key1, key2)
# verify that `__ne__` works as expected
self.assertTrue(key1 != key2)

def test_equal_private_keys(self):
key1 = PrivateKey(generator_ed25519, b"\x01" * 32)
key2 = PrivateKey(generator_ed25519, b"\x01" * 32)

self.assertEqual(key1, key2)
# verify that `__ne__` works as expected
self.assertFalse(key1 != key2)

def test_unequal_private_keys(self):
key1 = PrivateKey(generator_ed25519, b"\x01" * 32)
key2 = PrivateKey(generator_ed25519, b"\x02" * 32)

self.assertNotEqual(key1, key2)
# verify that `__ne__` works as expected
self.assertTrue(key1 != key2)

def test_unequal_privatekey_to_string(self):
Expand Down

0 comments on commit 4b51ae6

Please sign in to comment.