Skip to content

Commit

Permalink
update tests to assert determinism
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Oct 11, 2023
1 parent a92b223 commit 28c6595
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ def test_hashed_id(self):
self.assertGreater(len(machineid.hashed_id()), 0)
self.assertNotEqual(machineid.hashed_id('foo'), machineid.hashed_id('bar'))
self.assertNotEqual(machineid.hashed_id('foo'), machineid.hashed_id())
self.assertNotEqual(machineid.hashed_id('foo'), machineid.id())
self.assertNotEqual(machineid.hashed_id(), machineid.id())
self.assertEqual(machineid.hashed_id('foo'), machineid.hashed_id('foo'))
self.assertEqual(machineid.hashed_id(), machineid.hashed_id())

def test_id(self):
self.assertIsInstance(machineid.id(), str)
self.assertGreater(len(machineid.id()), 0)
self.assertNotEqual(machineid.id(), machineid.hashed_id())
self.assertEqual(machineid.id(), machineid.id())

if __name__ == '__main__':
unittest.main()

0 comments on commit 28c6595

Please sign in to comment.