def test_bugfix_type_match(self): testcase_file_path = os.path.join(os.getcwd(), 'tests/data/test_bugfix.yml') testcases = testcase._load_file(testcase_file_path) config_dict = {"path": testcase_file_path} self.test_runner.init_config(config_dict, "testset") test = testcases[2]["test"] self.assertTrue(self.test_runner._run_test(test))
def test_load_yaml_testcases(self): testcase_file_path = os.path.join( os.getcwd(), 'tests/data/demo_testset_hardcode.yml') testcases = testcase._load_file(testcase_file_path) self.assertEqual(len(testcases), 3) test = testcases[0]["test"] self.assertIn('name', test) self.assertIn('request', test) self.assertIn('url', test['request']) self.assertIn('method', test['request'])
def test_load_yaml_testcases(self): testcase_file_path = os.path.join( os.getcwd(), 'tests/data/demo_testset_hardcode.yml') testcases = testcase._load_file(testcase_file_path) self.assertEqual(len(testcases), 3) test = testcases[0]["test"] self.assertIn('name', test) self.assertIn('request', test) self.assertIn('url', test['request']) self.assertIn('method', test['request'])
def test_run_single_testcase(self): for testcase_file_path in self.testcase_file_path_list: testcases = testcase._load_file(testcase_file_path) test = testcases[0]["test"] self.assertTrue(self.test_runner._run_test(test)) test = testcases[1]["test"] self.assertTrue(self.test_runner._run_test(test)) test = testcases[2]["test"] self.assertTrue(self.test_runner._run_test(test))
def test_run_single_testcase(self): for testcase_file_path in self.testcase_file_path_list: testcases = testcase._load_file(testcase_file_path) config_dict = {"path": testcase_file_path} self.test_runner.init_config(config_dict, "testset") test = testcases[0]["test"] self.assertTrue(self.test_runner._run_test(test)) test = testcases[1]["test"] self.assertTrue(self.test_runner._run_test(test)) test = testcases[2]["test"] self.assertTrue(self.test_runner._run_test(test))
def test_load_testcases_bad_filepath(self): testcase_file_path = os.path.join(os.getcwd(), 'tests/data/demo') self.assertEqual(testcase._load_file(testcase_file_path), [])
def setUp(self): self.context = Context() testcase_file_path = os.path.join(os.getcwd(), 'tests/data/demo_binds.yml') self.testcases = testcase._load_file(testcase_file_path)
def setUp(self): self.context = Context() testcase_file_path = os.path.join(os.getcwd(), 'tests/data/demo_binds.yml') self.testcases = testcase._load_file(testcase_file_path)
def test_load_testcases_bad_filepath(self): testcase_file_path = os.path.join(os.getcwd(), 'tests/data/demo') self.assertEqual(testcase._load_file(testcase_file_path), [])