diff --git a/steam/steamid.py b/steam/steamid.py index 332a8db..07e134e 100644 --- a/steam/steamid.py +++ b/steam/steamid.py @@ -84,13 +84,13 @@ class SteamID(object): if type(value) in (int, EType): self.type = EType(value) else: - self.type = EType[value.lower().capitalize()] + self.type = EType[value] value = kwargs.get('universe', 1) if type(value) in (int, EUniverse): self.universe = EUniverse(value) else: - self.universe = EUniverse[value.lower().capitalize()] + self.universe = EUniverse[value] if 'instance' in kwargs: self.instance = kwargs['instance'] diff --git a/tests/test_steamid.py b/tests/test_steamid.py index 1047ff7..7a869bf 100644 --- a/tests/test_steamid.py +++ b/tests/test_steamid.py @@ -135,24 +135,24 @@ class SteamID_initialization(unittest.TestCase): SteamID(id=5, type="doesn't exist") with self.assertRaises(ValueError): SteamID(id=5, type=99999999) - with self.assertRaises(AttributeError): + with self.assertRaises(KeyError): SteamID(id=5, type=None) self.assertEqual(SteamID(id=5, type=1).type, EType.Individual) self.assertEqual(SteamID(id=5, type='Individual').type, EType.Individual) - self.assertEqual(SteamID(id=5, type='iNDIVIDUAL').type, EType.Individual) + self.assertEqual(SteamID(id=5, type='AnonUser').type, EType.AnonUser) def test_kwarg_universe(self): with self.assertRaises(KeyError): SteamID(id=5, universe="doesn't exist") with self.assertRaises(ValueError): SteamID(id=5, universe=99999999) - with self.assertRaises(AttributeError): + with self.assertRaises(KeyError): SteamID(id=5, universe=None) self.assertEqual(SteamID(id=5, universe=1).universe, EUniverse.Public) self.assertEqual(SteamID(id=5, universe='Public').universe, EUniverse.Public) - self.assertEqual(SteamID(id=5, universe='pUBLIC').universe, EUniverse.Public) + self.assertEqual(SteamID(id=5, universe='Dev').universe, EUniverse.Dev) def test_kwarg_instance(self): self.assertEqual(SteamID(id=5, instance=1234).instance, 1234) @@ -176,11 +176,6 @@ class SteamID_initialization(unittest.TestCase): universe='Invalid', instance=0, ), invalid) - self.compare(SteamID(id=0, - type='iNVALID', - universe='iNVALID', - instance=0, - ), invalid) class SteamID_properties(unittest.TestCase):