add remove_prefix utils

This commit is contained in:
httprunner
2017-11-02 18:42:26 +08:00
parent cc6fa938a0
commit e08e3d5299
2 changed files with 15 additions and 0 deletions

View File

@@ -8,6 +8,14 @@ from tests.base import ApiServerUnittest
class TestUtils(ApiServerUnittest):
def test_remove_prefix(self):
full_url = "http://debugtalk.com/post/123"
prefix = "http://debugtalk.com"
self.assertEqual(
utils.remove_prefix(full_url, prefix),
"/post/123"
)
def test_load_folder_files(self):
folder = os.path.join(os.getcwd(), 'tests')
file1 = os.path.join(os.getcwd(), 'tests', 'test_utils.py')