def test_run_single_testcase_json(self):
     testcase_file_path = os.path.join(
         os.getcwd(), 'test/data/simple_demo_auth_hardcode.json')
     testcases = utils.load_testcases(testcase_file_path)
     testcase = testcases[0]["test"]
     success, _ = self.test_runner.run_test(testcase)
     self.assertTrue(success)
 def test_run_testcase_template_yaml(self):
     testcase_file_path = os.path.join(
         os.getcwd(), 'test/data/demo_template_separate.yml')
     testcases = utils.load_testcases(testcase_file_path)
     success, _ = self.test_runner.run_test(testcases[0]["test"])
     self.assertTrue(success)
     success, _ = self.test_runner.run_test(testcases[1]["test"])
     self.assertTrue(success)
Esempio n. 3
0
 def test_load_yaml_testcases(self):
     testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo.yml')
     testcases = utils.load_testcases(testcase_file_path)
     self.assertEqual(len(testcases), 2)
     self.assertIn('name', testcases[0])
     self.assertIn('request', testcases[0])
     self.assertIn('response', testcases[0])
     self.assertIn('url', testcases[0]['request'])
     self.assertIn('method', testcases[0]['request'])
Esempio n. 4
0
 def test_load_yaml_testcases(self):
     testcase_file_path = os.path.join(os.getcwd(),
                                       'test/data/simple_demo_no_auth.yml')
     testcases = utils.load_testcases(testcase_file_path)
     self.assertEqual(len(testcases), 2)
     testcase = testcases[0]["test"]
     self.assertIn('name', testcase)
     self.assertIn('request', testcase)
     self.assertIn('url', testcase['request'])
     self.assertIn('method', testcase['request'])
Esempio n. 5
0
 def test_load_yaml_testcases(self):
     testcase_file_path = os.path.join(
         os.getcwd(), 'tests/data/demo_testset_hardcode.yml')
     testcases = utils.load_testcases(testcase_file_path)
     self.assertEqual(len(testcases), 3)
     testcase = testcases[0]["test"]
     self.assertIn('name', testcase)
     self.assertIn('request', testcase)
     self.assertIn('url', testcase['request'])
     self.assertIn('method', testcase['request'])
Esempio n. 6
0
 def test_load_yaml_testcases(self):
     testcase_file_path = os.path.join(
         os.getcwd(), 'tests/data/demo_testset_hardcode.yml')
     testcases = utils.load_testcases(testcase_file_path)
     self.assertEqual(len(testcases), 3)
     testcase = testcases[0]["test"]
     self.assertIn('name', testcase)
     self.assertIn('request', testcase)
     self.assertIn('url', testcase['request'])
     self.assertIn('method', testcase['request'])
Esempio n. 7
0
    def test_run_single_testcase(self):
        for testcase_file_path in self.testcase_file_path_list:
            testcases = utils.load_testcases(testcase_file_path)
            testcase = testcases[0]["test"]
            self.assertTrue(self.test_runner.run_test(testcase))

            testcase = testcases[1]["test"]
            self.assertTrue(self.test_runner.run_test(testcase))

            testcase = testcases[2]["test"]
            self.assertTrue(self.test_runner.run_test(testcase))
Esempio n. 8
0
    def test_run_single_testcase(self):
        for testcase_file_path in self.testcase_file_path_list:
            testcases = utils.load_testcases(testcase_file_path)
            testcase = testcases[0]["test"]
            self.assertTrue(self.test_runner.run_test(testcase))

            testcase = testcases[1]["test"]
            self.assertTrue(self.test_runner.run_test(testcase))

            testcase = testcases[2]["test"]
            self.assertTrue(self.test_runner.run_test(testcase))
Esempio n. 9
0
 def setUp(self):
     self.context = Context()
     testcase_file_path = os.path.join(os.getcwd(),
                                       'tests/data/demo_binds.yml')
     self.testcases = utils.load_testcases(testcase_file_path)
Esempio n. 10
0
 def test_load_testcases_bad_filepath(self):
     testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo')
     with self.assertRaises(exception.ParamsError):
         utils.load_testcases(testcase_file_path)
Esempio n. 11
0
 def test_run_testcase_suite_yaml_success(self):
     testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo.yml')
     testcases = utils.load_testcases(testcase_file_path)
     result = self.test_runner.run_testcase_suite(testcases)
     self.assertEqual(len(result), 2)
     self.assertEqual(result, [(True, {}), (True, {})])
Esempio n. 12
0
 def test_run_single_testcase_success(self):
     testcase_file_path = os.path.join(os.getcwd(), 'test/data/demo.json')
     testcases = utils.load_testcases(testcase_file_path)
     success, _ = self.test_runner.run_single_testcase(testcases[0])
     self.assertTrue(success)
Esempio n. 13
0
 def test_load_testcases_bad_filepath(self):
     testcase_file_path = os.path.join(os.getcwd(), 'tests/data/demo')
     self.assertEqual(utils.load_testcases(testcase_file_path), [])
Esempio n. 14
0
 def test_load_testcases_bad_filepath(self):
     testcase_file_path = os.path.join(os.getcwd(), 'tests/data/demo')
     self.assertEqual(utils.load_testcases(testcase_file_path), [])
Esempio n. 15
0
 def setUp(self):
     self.context = Context()
     testcase_file_path = os.path.join(os.getcwd(), 'tests/data/demo_binds.yml')
     self.testcases = utils.load_testcases(testcase_file_path)