|
@ -18,14 +18,14 @@ class SteamID_initialization(unittest.TestCase): |
|
|
self.assertEqual(hash(SteamID(1)), hash(SteamID(1))) |
|
|
self.assertEqual(hash(SteamID(1)), hash(SteamID(1))) |
|
|
self.assertNotEqual(hash(SteamID(12345)), hash(SteamID(8888))) |
|
|
self.assertNotEqual(hash(SteamID(12345)), hash(SteamID(8888))) |
|
|
|
|
|
|
|
|
def test_cmp(self): |
|
|
def test_rich_comperison(self): |
|
|
self.assertEqual(SteamID(1), SteamID(1)) |
|
|
for test_value in [SteamID(5), 5, '5']: |
|
|
self.assertTrue(SteamID(2) > SteamID(1)) |
|
|
self.assertFalse(SteamID(10) == test_value) |
|
|
self.assertTrue(SteamID(2) < SteamID(4)) |
|
|
self.assertTrue(SteamID(10) != test_value) |
|
|
|
|
|
self.assertTrue(SteamID(10) > test_value) |
|
|
with self.assertRaises(RuntimeError): |
|
|
self.assertTrue(SteamID(10) >= test_value) |
|
|
a = SteamID(5) == 5 |
|
|
self.assertFalse(SteamID(10) < test_value) |
|
|
b = SteamID(5) == '5' |
|
|
self.assertFalse(SteamID(10) <= test_value) |
|
|
|
|
|
|
|
|
def test_is_valid(self): |
|
|
def test_is_valid(self): |
|
|
self.assertTrue(SteamID(1).is_valid()) |
|
|
self.assertTrue(SteamID(1).is_valid()) |
|
|