def test_valid(self): players = PingResponse.Version({"name": "foo", "protocol": 5}) assert players.name == "foo" assert players.protocol == 5
def test_valid(self): players = PingResponse.Version({"name": "foo", "protocol": 5}) self.assertEqual(players.name, "foo") self.assertEqual(players.protocol, 5)
def test_name_invalid(self): with pytest.raises(ValueError): PingResponse.Version({"name": {}, "protocol": 5})
def test_name_missing(self): with pytest.raises(ValueError): PingResponse.Version({"protocol": 5})
def test_protocol_invalid(self): with pytest.raises(ValueError): PingResponse.Version({"name": "foo", "protocol": "bar"})
def test_protocol_missing(self): with pytest.raises(ValueError): PingResponse.Version({"name": "foo"})
def test_invalid(self): with pytest.raises(ValueError): PingResponse.Version("foo")