Esempio n. 1
0
    def test_multiple_nodes(self):
        number_of_nodes = 10
        wp = WorkProvider()
        nodes = [MockWorkNode]
        for i in range(0, number_of_nodes):
            node = MockWorkNode()
            node.i = i
            nodes.append(node)
        wp.add_nodes(*nodes)

        for i in range(0, number_of_nodes):
            node = wp.get_next_node()
            self.assertEqual(node.i, nodes[i].i)
Esempio n. 2
0
    def test_multiple_nodes(self):
        number_of_nodes = 10
        wp = WorkProvider()
        nodes = [MockWorkNode]
        for i in range(0, number_of_nodes):
            node = MockWorkNode()
            node.i = i
            nodes.append(node)
        wp.add_nodes(*nodes)

        for i in range(0, number_of_nodes):
            node = wp.get_next_node()
            self.assertEqual(node.i, nodes[i].i)
    def add_tests(self, test_json):
        """Takes a list of tests in the format required by the configuration file 
        and adds them to the tests that this TestRunner will run."""
        configuration = test_json['configuration']
        for thread in test_json['tests']:
            work_provider = WorkProvider() 
            work_nodes = []
            for test in thread:
                test_obj = {
                    'test': test,
                    'configuration': configuration,
                    'environment': {},
                }
                work_nodes.extend(TestLoader.get_work_nodes_for_test(test_obj))

            work_provider.add_nodes(*work_nodes)
            self.work_providers.append(work_provider)
    def add_tests(self, test_json):
        """Takes a list of tests in the format required by the configuration file 
        and adds them to the tests that this TestRunner will run."""
        configuration = test_json['configuration']
        for thread in test_json['tests']:
            work_provider = WorkProvider()
            work_nodes = []
            for test in thread:
                test_obj = {
                    'test': test,
                    'configuration': configuration,
                    'environment': {},
                }
                work_nodes.extend(TestLoader.get_work_nodes_for_test(test_obj))

            work_provider.add_nodes(*work_nodes)
            self.work_providers.append(work_provider)
Esempio n. 5
0
 def test_single_node(self):
     wp = WorkProvider()
     node = MockWorkNode()
     wp.add_nodes(node)
     self.assertEqual(node, wp.get_next_node())
Esempio n. 6
0
 def test_single_node(self):
     wp = WorkProvider()
     node = MockWorkNode()
     wp.add_nodes(node)
     self.assertEqual(node, wp.get_next_node())