Ejemplo n.º 1
0
    def test_thread(self):
        outfile = tempfile.NamedTemporaryFile()
        params = Params()
        params.concurrency = 2
        params.iterations = 10
        params.report = outfile.name
        params.tests = dummy_tests

        worker = Worker(params)
        worker.run_nose(params)
Ejemplo n.º 2
0
 def test_loadgen(self):
     params = Params()
     params.iterations = 1
     params.concurrency = 1
     params.report = 'log.ldjson'
     params.tests = dummy_tests
     worker = Worker(params)
     worker.run_nose(params)
     action_handlers = thread.get_from_thread_store('action_handlers')
     plugin = action_handlers.pop(0)
     self.assertTrue(plugin.started)
     self.assertTrue(plugin.ended)
Ejemplo n.º 3
0
    def test_setup_teardown_graceful(self):
        error_tests = [
            os.path.join(RESOURCES_DIR, "setup_teardown_graceful.py")
        ]

        outfile = tempfile.NamedTemporaryFile()
        params = Params()
        params.concurrency = 1
        params.iterations = 1
        params.report = outfile.name
        params.tests = error_tests
        params.verbose = True

        worker = Worker(params)
        worker.run_nose(params)

        # todo: fix result of "samples = self.apiritif_extractor.parse_recording(recording, sample)"
        test_result = apiritif.get_from_thread_store('test_result')
        sample = [
            '1. setup1', '2. setup2', '3. main1', '4. main2', '5. teardown1',
            '6. teardown2'
        ]
        self.assertEqual(sample, test_result)