def test_platform_play(): bf = Battlefield('test', '123456', 'playstation') assert bf.get_platform() == 2
def test_platform_error(): bf = Battlefield('test', '123456', 'nintendo') with pytest.raises(PlatformError) as ex_info: bf.get_platform() assert 'Platform unavailable' in str(ex_info.value)
def test_platform_pc(): bf = Battlefield('test', '123456', 'PC') assert bf.get_platform() == 3
def test_platform_xbox(): bf = Battlefield('test', '123456', 'Xbox') assert bf.get_platform() == 1
def test_platform_is_integer(): bf = Battlefield('test', '12345', 3) assert bf.get_platform() == 3
def test_platform_with_number_greater_than_3(): bf = Battlefield('test', '123456', 4) with pytest.raises(PlatformError) as ex_info: bf.get_platform() assert 'Platform unavailable' in str(ex_info)