def test_get_new_commands(self): ip = "127.0.0.1" port = 8080 unit_id = "3c82ef61-0875-41d3-99ba-101672d79d6b" testunit = Unit(ip, unit_id, fallback_units = []) # Post five tasks to taskboard for _ in xrange(5): task = create_valid_task() # Posting a task should result in no error testunit.post_task(task) tasks = testunit.get_new_commands() print tasks self.assertTrue(len(tasks) == 5)
def test_get_new_commands(self): ip = "127.0.0.1" port = 8080 unit_id = "3c82ef61-0875-41d3-99ba-101672d79d6b" testunit = Unit(ip, unit_id, fallback_units=[]) # Post five tasks to taskboard for _ in xrange(5): task = create_valid_task() # Posting a task should result in no error testunit.post_task(task) tasks = testunit.get_new_commands() print tasks self.assertTrue(len(tasks) == 5)
def test_get_new_commands(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_commands() for task in tasks: self.assertTrue(task.response == {})
def test_get_new_commands(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_commands() for task in tasks: self.assertTrue(task.response == {})