示例#1
0
    def test_valid(self):
        players = PingResponse.Version({"name": "foo", "protocol": 5})

        assert players.name == "foo"
        assert players.protocol == 5
示例#2
0
    def test_valid(self):
        players = PingResponse.Version({"name": "foo", "protocol": 5})

        self.assertEqual(players.name, "foo")
        self.assertEqual(players.protocol, 5)
示例#3
0
 def test_name_invalid(self):
     with pytest.raises(ValueError):
         PingResponse.Version({"name": {}, "protocol": 5})
示例#4
0
 def test_name_missing(self):
     with pytest.raises(ValueError):
         PingResponse.Version({"protocol": 5})
示例#5
0
 def test_protocol_invalid(self):
     with pytest.raises(ValueError):
         PingResponse.Version({"name": "foo", "protocol": "bar"})
示例#6
0
 def test_protocol_missing(self):
     with pytest.raises(ValueError):
         PingResponse.Version({"name": "foo"})
示例#7
0
 def test_invalid(self):
     with pytest.raises(ValueError):
         PingResponse.Version("foo")