bugfix: locustfile template can not be found

This commit is contained in:
debugtalk
2017-08-22 16:02:57 +08:00
parent 4777817ff7
commit 275f4fda77
2 changed files with 6 additions and 2 deletions

View File

@@ -1 +1 @@
__version__ = '0.4.0'
__version__ = '0.4.1'

View File

@@ -137,7 +137,11 @@ def gen_locustfile(testcase_file_path):
""" generate locustfile from template.
"""
locustfile_path = 'locustfile.py'
with codecs.open('ate/locustfile_template', encoding='utf-8') as template:
template_path = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'locustfile_template'
)
with codecs.open(template_path, encoding='utf-8') as template:
with codecs.open(locustfile_path, 'w', encoding='utf-8') as locustfile:
template_content = template.read()
template_content = template_content.replace("$HOST", "https://skypixel.com")