Exemplo n.º 1
0
 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'])
Exemplo n.º 2
0
    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))
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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), [])