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
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"
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"
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]"
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]"
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]"
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()