mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-18 02:57:36 +08:00
fix Python version compability
This commit is contained in:
@@ -97,8 +97,8 @@ class TestTestcaseLoader(unittest.TestCase):
|
||||
|
||||
TestcaseLoader._override_block(def_block, test_block)
|
||||
self.assertEqual(test_block["name"], "override block")
|
||||
self.assertEqual(test_block["validate"][0], {'check': 'status_code', 'expect': 201, 'comparator': 'eq'})
|
||||
self.assertEqual(test_block["validate"][1], {'check': 'content.token', 'comparator': 'len_eq', 'expect': 32})
|
||||
self.assertIn({'check': 'status_code', 'expect': 201, 'comparator': 'eq'}, test_block["validate"])
|
||||
self.assertIn({'check': 'content.token', 'comparator': 'len_eq', 'expect': 32}, test_block["validate"])
|
||||
|
||||
def test_load_testcases_by_path_files(self):
|
||||
testsets_list = []
|
||||
|
||||
@@ -62,7 +62,7 @@ class TestFileUtils(unittest.TestCase):
|
||||
|
||||
def test_load_testcases_bad_filepath(self):
|
||||
testcase_file_path = os.path.join(os.getcwd(), 'tests/data/demo')
|
||||
with self.assertRaises(FileNotFoundError):
|
||||
with self.assertRaises(exception.FileNotFoundError):
|
||||
FileUtils.load_file(testcase_file_path)
|
||||
|
||||
def test_load_json_testcases(self):
|
||||
|
||||
Reference in New Issue
Block a user