Browse Source

fix #19; use long as base for SteamID under py2

pull/18/merge
Rossen Georgiev 9 years ago
parent
commit
452975590d
  1. 8
      steam/steamid.py
  2. 3
      tests/test_steamid.py

8
steam/steamid.py

@ -1,7 +1,13 @@
import sys
import re import re
from steam.enums.base import SteamIntEnum from steam.enums.base import SteamIntEnum
from steam.enums import EType, EUniverse from steam.enums import EType, EUniverse
if sys.version_info < (3,):
intBase = long
else:
intBase = int
class ETypeChar(SteamIntEnum): class ETypeChar(SteamIntEnum):
I = EType.Invalid I = EType.Invalid
U = EType.Individual U = EType.Individual
@ -22,7 +28,7 @@ class ETypeChar(SteamIntEnum):
ETypeChars = ''.join(map(str, list(ETypeChar))) ETypeChars = ''.join(map(str, list(ETypeChar)))
class SteamID(int): class SteamID(intBase):
""" """
Object for converting steamID to its' various representations Object for converting steamID to its' various representations

3
tests/test_steamid.py

@ -189,9 +189,6 @@ class SteamID_properties(unittest.TestCase):
self.assertFalse(SteamID(10) < test_value) self.assertFalse(SteamID(10) < test_value)
self.assertFalse(SteamID(10) <= test_value) self.assertFalse(SteamID(10) <= test_value)
def test_is_instance_of_int(self):
self.assertIsInstance(SteamID(5), int)
def test_str(self): def test_str(self):
self.assertEqual(str(SteamID(76580280500085312)), '76580280500085312') self.assertEqual(str(SteamID(76580280500085312)), '76580280500085312')

Loading…
Cancel
Save