fix: typo error

This commit is contained in:
debugtalk
2020-06-19 22:27:54 +08:00
parent e5fdff03c1
commit 1918f62c64
3 changed files with 5 additions and 6 deletions

View File

@@ -365,7 +365,7 @@ class HarParser(object):
utils.dump_yaml(testcase, output_testcase_file) utils.dump_yaml(testcase, output_testcase_file)
else: else:
# default to generate pytest file # default to generate pytest file
testcase["config"]["path"] = os.path.join(os.getcwd(), self.har_file_path) testcase["config"]["path"] = self.har_file_path
output_testcase_file = make_testcase(testcase) output_testcase_file = make_testcase(testcase)
format_pytest_with_black(output_testcase_file) format_pytest_with_black(output_testcase_file)

View File

@@ -46,10 +46,9 @@ import os
import sys import sys
from typing import Text, NoReturn from typing import Text, NoReturn
from loguru import logger
from httprunner.parser import parse_variables_mapping
from httprunner.models import TStep, FunctionsMapping from httprunner.models import TStep, FunctionsMapping
from httprunner.parser import parse_variables_mapping
from loguru import logger
try: try:
import filetype import filetype
@@ -146,7 +145,7 @@ def multipart_encoder(**kwargs):
# value is not absolute file path, check if it is relative file path # value is not absolute file path, check if it is relative file path
from httprunner.loader import load_project_meta from httprunner.loader import load_project_meta
project_meta = load_project_meta(os.getcwd()) project_meta = load_project_meta("")
_file_path = os.path.join(project_meta.RootDir, value) _file_path = os.path.join(project_meta.RootDir, value)
is_exists_file = os.path.isfile(_file_path) is_exists_file = os.path.isfile(_file_path)

View File

@@ -361,7 +361,7 @@ def make_testcase(testcase: Dict, dir_path: Text = None) -> Text:
teststep["testcase"] = ref_testcase_cls_name teststep["testcase"] = ref_testcase_cls_name
# prepare import ref testcase # prepare import ref testcase
ref_testcase_python_path = ref_testcase_python_path[len(os.getcwd()) + 1 :] ref_testcase_python_path = __ensure_cwd_relative(ref_testcase_python_path)
ref_module_name, _ = os.path.splitext(ref_testcase_python_path) ref_module_name, _ = os.path.splitext(ref_testcase_python_path)
ref_module_name = ref_module_name.replace(os.sep, ".") ref_module_name = ref_module_name.replace(os.sep, ".")
imports_list.append( imports_list.append(