def test_valid(self): players = QueryResponse.Players(5, 20, ["Dinnerbone", "Djinnibone", "Steve"]) self.assertEqual(players.online, 5) self.assertEqual(players.max, 20) self.assertEqual(players.names, ["Dinnerbone", "Djinnibone", "Steve"])
def test_valid(self): response = QueryResponse(self.raw, self.players) assert response.motd == "A Minecraft Server" assert response.map == "world" assert response.players.online == 3 assert response.players.max == 20 assert response.players.names == ["Dinnerbone", "Djinnibone", "Steve"] assert response.software.brand == "vanilla" assert response.software.version == "1.8" assert response.software.plugins == []
def test_valid(self): response = QueryResponse(self.raw, self.players) self.assertEqual(response.motd, "A Minecraft Server") self.assertEqual(response.map, "world") self.assertEqual(response.players.online, 3) self.assertEqual(response.players.max, 20) self.assertEqual(response.players.names, ["Dinnerbone", "Djinnibone", "Steve"]) self.assertEqual(response.software.brand, "vanilla") self.assertEqual(response.software.version, "1.8") self.assertEqual(response.software.plugins, [])
def test_modded(self): software = QueryResponse.Software( "1.8", "A modded server: Foo 1.0; Bar 2.0; Baz 3.0") self.assertEqual(software.brand, "A modded server") self.assertEqual(software.plugins, ["Foo 1.0", "Bar 2.0", "Baz 3.0"])
def test_vanilla(self): software = QueryResponse.Software("1.8", "") self.assertEqual(software.brand, "vanilla") self.assertEqual(software.version, "1.8") self.assertEqual(software.plugins, [])
def test_modded_no_plugins(self): software = QueryResponse.Software("1.8", "A modded server") self.assertEqual(software.brand, "A modded server") self.assertEqual(software.plugins, [])
def test_modded_no_plugins(self): software = QueryResponse.Software("1.8", "A modded server") assert software.brand == "A modded server" assert software.plugins == []
def test_modded(self): software = QueryResponse.Software("1.8", "A modded server: Foo 1.0; Bar 2.0; Baz 3.0") assert software.brand == "A modded server" assert software.plugins == ["Foo 1.0", "Bar 2.0", "Baz 3.0"]
def test_vanilla(self): software = QueryResponse.Software("1.8", "") assert software.brand == "vanilla" assert software.version == "1.8" assert software.plugins == []
def test_valid2(self): players = QueryResponse.Players(5, 20, ["Dinnerbone", "Djinnibone", "Steve"]) assert players.online == 5 assert players.max == 20 assert players.names == ["Dinnerbone", "Djinnibone", "Steve"]