예제 #1
0
    def test_run_singe_yaml(self):
        singe_api_yaml = os.path.join(os.path.dirname(__file__), "api",
                                      "get_login.yaml")
        result = run_yaml(singe_api_yaml)
        self.assertEqual(result[0], True)

        singe_api_yaml = os.path.join(os.path.dirname(__file__), "api",
                                      "get_homepage.yaml")
        result = run_yaml(singe_api_yaml)
        self.assertEqual(result[0], True)
예제 #2
0
    def test_loader_single_yaml(self):
        single_testcase_yaml = os.path.join(os.path.dirname(__file__), "api", "get_homepage.yml")
        result=run_yaml(single_testcase_yaml)
        self.assertEqual(len(result), 1)
        self.assertEqual(result[0], True)

        single_testcase_yaml = os.path.join(os.path.dirname(__file__), "api", "api_login_submit.yml")
        result = run_yaml(single_testcase_yaml)
        self.assertEqual(len(result), 1)
        self.assertEqual(result[0], True)
예제 #3
0
def main():
    """ API test: parse command line options and run commands.
    """
    parser = argparse.ArgumentParser(description="hogwarts httprunner")
    parser.add_argument('-V',
                        '--version',
                        dest='version',
                        action='store_true',
                        help="show version")
    parser.add_argument('yaml_path', help="yaml file path")

    args = parser.parse_args()

    if len(sys.argv) == 1:
        # no argument passed
        parser.print_help()
        return 0
    print("testpath---", args.yaml_path)
    success = run_yaml(args.yaml_path)
    return success
예제 #4
0
 def test_run_single_jsonpath(self):
     singe_api_yaml = os.path.join(os.path.dirname(__file__), "api",
                                   "get_login_submit.yaml")
     result = run_yaml(singe_api_yaml)
     self.assertEqual(result[0], True)
예제 #5
0
 def test_run_single_yaml_with_jsonpath(self):
     single_testcase_yaml = os.path.join(os.path.dirname(__file__), "api",
                                         "api_login_submit.yml")
     result = run_yaml(single_testcase_yaml)
     self.assertEqual(len(result), 1)
     self.assertEqual(result[0], True)
예제 #6
0
 def test_run_testcase_yml(self):
     single_api_yml = os.path.join(os.path.dirname(__file__), "testcase", "mubu_login.yml")
     #print(single_api_yml)
     result =run_yaml(single_api_yml)
     self.assertEqual(len(result), 4)
예제 #7
0
 def test_run_yaml_yaml(self):
     testcase_api_yaml = os.path.join(os.path.dirname(__file__), "testcase", "mubu_login.yaml")
     r= run_yaml(testcase_api_yaml)
     self.assertEqual(len(r),4)