Exemplo n.º 1
0
    def test_get_new_responses(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])
        # Post five tasks to taskboard

        for _ in xrange(5):
            command, response = create_valid_task()
            # Posting a task should result in no error
            testunit.post_task(command)

        for _ in xrange(5):
            command, response = create_valid_task()
            # Posting a task should result in no error
            testunit.post_task(response)

        tasks = testunit.get_new_responses()
        for task in tasks:
            self.assertTrue(task.response <> {})
 def test_get_new_responses(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])
     # Post five tasks to taskboard
     
     for _ in xrange(5):
         command, response = create_valid_task()
         # Posting a task should result in no error
         testunit.post_task(command)
     
     for _ in xrange(5):
         command, response = create_valid_task()
         # Posting a task should result in no error
         testunit.post_task(response)
     
     tasks = testunit.get_new_responses()
     for task in tasks:
         self.assertTrue(task.response <> {})