From 275f4fda77b8f4f18468389659608c39158d2b15 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Tue, 22 Aug 2017 16:02:57 +0800 Subject: [PATCH] bugfix: locustfile template can not be found --- ate/__init__.py | 2 +- ate/cli.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ate/__init__.py b/ate/__init__.py index 222c11cf..b703f5c9 100644 --- a/ate/__init__.py +++ b/ate/__init__.py @@ -1 +1 @@ -__version__ = '0.4.0' \ No newline at end of file +__version__ = '0.4.1' \ No newline at end of file diff --git a/ate/cli.py b/ate/cli.py index 3453b26c..4f30f7e6 100644 --- a/ate/cli.py +++ b/ate/cli.py @@ -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")