mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-18 03:27:35 +08:00
change: make converted referenced pytest files always relative to project RootDir
This commit is contained in:
@@ -5,7 +5,6 @@ import unittest
|
||||
|
||||
from httprunner import loader, utils
|
||||
from httprunner.utils import (
|
||||
ensure_file_abs_path_valid,
|
||||
ExtendJSONEncoder,
|
||||
override_config_variables,
|
||||
)
|
||||
@@ -105,41 +104,6 @@ class TestUtils(unittest.TestCase):
|
||||
["A", "D", "C", "B"],
|
||||
)
|
||||
|
||||
def test_ensure_file_path_valid(self):
|
||||
self.assertEqual(
|
||||
ensure_file_abs_path_valid(
|
||||
os.path.join(os.getcwd(), "examples", "a-b.c", "d f", "hardcode.yml")
|
||||
),
|
||||
os.path.join(os.getcwd(), "examples", "a_b_c", "d_f", "hardcode.yml"),
|
||||
)
|
||||
self.assertEqual(
|
||||
ensure_file_abs_path_valid(os.path.join(os.getcwd(), "1", "2B", "3.yml")),
|
||||
os.path.join(os.getcwd(), "T1", "T2B", "T3.yml"),
|
||||
)
|
||||
self.assertEqual(
|
||||
ensure_file_abs_path_valid(
|
||||
os.path.join(os.getcwd(), "examples", "a-b.c", "2B", "hardcode.yml")
|
||||
),
|
||||
os.path.join(os.getcwd(), "examples", "a_b_c", "T2B", "hardcode.yml"),
|
||||
)
|
||||
self.assertEqual(
|
||||
ensure_file_abs_path_valid(
|
||||
os.path.join(os.getcwd(), "examples", "postman_echo", "request_methods")
|
||||
),
|
||||
os.path.join(os.getcwd(), "examples", "postman_echo", "request_methods"),
|
||||
)
|
||||
self.assertEqual(
|
||||
ensure_file_abs_path_valid(os.path.join(os.getcwd(), "test.yml")),
|
||||
os.path.join(os.getcwd(), "test.yml"),
|
||||
)
|
||||
self.assertEqual(
|
||||
ensure_file_abs_path_valid(os.getcwd()), os.getcwd(),
|
||||
)
|
||||
self.assertEqual(
|
||||
ensure_file_abs_path_valid(os.path.join(os.getcwd(), "demo", ".csv")),
|
||||
os.path.join(os.getcwd(), "demo", ".csv"),
|
||||
)
|
||||
|
||||
def test_safe_dump_json(self):
|
||||
class A(object):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user