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

        assert players.name == "foo"
        assert players.protocol == 5
コード例 #2
0
ファイル: test_pinger.py プロジェクト: masonrapa/LiSi-Tool
    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")