Ejemplo n.º 1
0
 def test_individual(self):
     id_ = steamid.SteamID(44647673, 0, steamid.TYPE_INDIVIDUAL,
                           steamid.UNIVERSE_INDIVIDUAL)
     assert int(id_) == 76561198049561074
Ejemplo n.º 2
0
 def test_group(self):
     id_ = steamid.SteamID(44647673, 1, steamid.TYPE_CLAN,
                           steamid.UNIVERSE_INDIVIDUAL)
     assert int(id_) == 103582791518816755
Ejemplo n.º 3
0
 def test_other(self):
     id_ = steamid.SteamID(1, 0, steamid.TYPE_INDIVIDUAL,
                           steamid.UNIVERSE_INDIVIDUAL)
     assert str(id_) == "STEAM_0:0:1"
Ejemplo n.º 4
0
 def test_bad_type(self, type_):
     id_ = steamid.SteamID(1, 0, type_, steamid.UNIVERSE_INDIVIDUAL)
     with pytest.raises(steamid.SteamIDError):
         int(id_)
Ejemplo n.º 5
0
 def test_invalid(self):
     id_ = steamid.SteamID(1, 0, steamid.TYPE_INVALID,
                           steamid.UNIVERSE_INDIVIDUAL)
     assert str(id_) == "UNKNOWN"
Ejemplo n.º 6
0
 def test_pending(self):
     id_ = steamid.SteamID(1, 0, steamid.TYPE_PENDING,
                           steamid.UNIVERSE_INDIVIDUAL)
     assert str(id_) == "STEAM_ID_PENDING"
Ejemplo n.º 7
0
def test_type_name(type_, as_string):
    id_ = steamid.SteamID(1, 0, type_, steamid.UNIVERSE_INDIVIDUAL)
    assert id_.type_name == as_string
Ejemplo n.º 8
0
 def test_account_number_too_big(self):
     with pytest.raises(steamid.SteamIDError):
         steamid.SteamID(4294967296, 0, steamid.TYPE_INDIVIDUAL,
                         steamid.UNIVERSE_INDIVIDUAL)
Ejemplo n.º 9
0
 def test_account_number_too_small(self):
     with pytest.raises(steamid.SteamIDError):
         steamid.SteamID(-1, 0, steamid.TYPE_INDIVIDUAL,
                         steamid.UNIVERSE_INDIVIDUAL)