예제 #1
0
    def test_encode(self):
        response = ControlResponse()
        response.setStatusCode(404)
        response.setStatusText("Nothing not found")
        response.setBodyAsControlParameters(ControlParameters())
        response.getBodyAsControlParameters().setFaceId(10)
        wire = response.wireEncode()

        self.assertTrue(wire.equals(TestControlResponse1))
예제 #2
0
    def test_decode(self):
        response = ControlResponse()
        response.wireDecode(TestControlResponse1)

        self.assertEqual(response.getStatusCode(), 404)
        self.assertEqual(response.getStatusText(), "Nothing not found")
        self.assertEqual(response.getBodyAsControlParameters().getFaceId(), 10)
예제 #3
0
    def test_decode(self):
        response = ControlResponse()
        response.wireDecode(TestControlResponse1)

        self.assertEqual(response.getStatusCode(), 404);
        self.assertEqual(response.getStatusText(), "Nothing not found");
        self.assertEqual(response.getBodyAsControlParameters().getFaceId(), 10);
예제 #4
0
    def test_encode(self):
        response = ControlResponse()
        response.setStatusCode(404)
        response.setStatusText("Nothing not found")
        response.setBodyAsControlParameters(ControlParameters())
        response.getBodyAsControlParameters().setFaceId(10)
        wire = response.wireEncode()

        self.assertTrue(wire.equals(TestControlResponse1))