def test_get_response(self):
     ip = "127.0.0.1"
     port = 8080
     unit_id = "3c82ef61-0875-41d3-99ba-101672d79d6b"
     testunit = Unit(ip, unit_id, fallback_units = [])
     
     valid_command = create_valid_task()
     valid_response = create_valid_task()
     valid_response.add_response(response = {"Response":1})
     
     testunit.post_task(valid_command)
     testunit.post_task(valid_response)
     
     testunit.get_response(valid_command)
Exemple #2
0
    def test_get_response(self):
        ip = "127.0.0.1"
        port = 8080
        unit_id = "3c82ef61-0875-41d3-99ba-101672d79d6b"
        testunit = Unit(ip, unit_id, fallback_units=[])

        valid_command = create_valid_task()
        valid_response = create_valid_task()
        valid_response.add_response(response={"Response": 1})

        testunit.post_task(valid_command)
        testunit.post_task(valid_response)

        testunit.get_response(valid_command)
Exemple #3
0
    def test_get_response(self):
        ip = "127.0.0.1"
        port = 8080
        unit_id = "3c82ef61-0875-41d3-99ba-101672d79d6b"
        testunit = Unit(ip, unit_id, fallback_units=[])
        setup_server([testunit])

        # Create a valid command and response to use in this test
        command, response = create_valid_task()

        # Post a command, no exception
        testunit.post_task(command)

        # Post a response, no exception
        testunit.post_task(response)

        testunit_response = testunit.get_response(command)
        self.assertTrue(isinstance(testunit_response, Task))
        self.assertTrue(testunit_response.task_id == response.task_id)
        print response
 def test_get_response(self):
     ip = "127.0.0.1"
     port = 8080
     unit_id = "3c82ef61-0875-41d3-99ba-101672d79d6b"
     testunit = Unit(ip, unit_id, fallback_units = [])
     setup_server([testunit])
     
     # Create a valid command and response to use in this test
     command, response = create_valid_task()
     
     # Post a command, no exception
     testunit.post_task(command)
     
     # Post a response, no exception
     testunit.post_task(response)
     
     testunit_response = testunit.get_response(command)
     self.assertTrue(isinstance(testunit_response, Task))
     self.assertTrue(testunit_response.task_id == response.task_id )
     print response