コード例 #1
0
ファイル: test_SteamID.py プロジェクト: russelg/PySteam
def test_steamid64_anon_gameserver():
    sid = SteamID()
    sid.universe = SteamID.Universe.PUBLIC
    sid.type = SteamID.Type.ANON_GAMESERVER
    sid.instance = 188991
    sid.accountid = 42135013
    assert sid.as_64 == 90883702753783269
コード例 #2
0
ファイル: test_SteamID.py プロジェクト: russelg/PySteam
def test_steamid64_rendering_individual_str():
    sid = SteamID()
    sid.universe = SteamID.Universe.PUBLIC
    sid.type = SteamID.Type.INDIVIDUAL
    sid.instance = SteamID.Instance.DESKTOP
    sid.accountid = 46143802
    assert str(sid) == "76561198006409530"
コード例 #3
0
ファイル: test_SteamID.py プロジェクト: russelg/PySteam
def test_steam2id_rendering_universe_0():
    sid = SteamID()
    sid.universe = SteamID.Universe.PUBLIC
    sid.type = SteamID.Type.INDIVIDUAL
    sid.instance = SteamID.Instance.DESKTOP
    sid.accountid = 46143802
    assert sid.as_steam2_zero == "STEAM_0:0:23071901"
    assert sid._as_steam2(False) == "STEAM_0:0:23071901"
コード例 #4
0
ファイル: test_SteamID.py プロジェクト: russelg/PySteam
def test_steam3id_rendering_lobby():
    sid = SteamID()
    sid.universe = SteamID.Universe.PUBLIC
    sid.type = SteamID.Type.CHAT
    sid.instance = SteamID.ChatInstanceFlags.LOBBY
    sid.accountid = 451932
    assert sid.as_steam3 == "[L:1:451932]"
    assert sid.steam_id3 == "[L:1:451932]"
コード例 #5
0
ファイル: test_SteamID.py プロジェクト: russelg/PySteam
def test_steam3id_rendering_anon_gameserver():
    sid = SteamID()
    sid.universe = SteamID.Universe.PUBLIC
    sid.type = SteamID.Type.ANON_GAMESERVER
    sid.instance = 41511
    sid.accountid = 43253156
    assert sid.as_steam3 == "[A:1:43253156:41511]"
    assert sid.steam_id3 == "[A:1:43253156:41511]"
コード例 #6
0
ファイル: test_SteamID.py プロジェクト: russelg/PySteam
def test_steam3id_rendering_individual():
    sid = SteamID()
    sid.universe = SteamID.Universe.PUBLIC
    sid.type = SteamID.Type.INDIVIDUAL
    sid.instance = SteamID.Instance.DESKTOP
    sid.accountid = 46143802
    assert sid.as_steam3 == "[U:1:46143802]"
    assert sid.steam_id3 == "[U:1:46143802]"
コード例 #7
0
ファイル: test_SteamID.py プロジェクト: russelg/PySteam
def test_steam2id_rendering_non_individual():
    with pytest.raises(Exception):
        sid = SteamID()
        sid.universe = SteamID.Universe.PUBLIC
        sid.type = SteamID.Type.CLAN
        sid.instance = SteamID.Instance.DESKTOP
        sid.accountid = 4681548
        sid._as_steam2()