Skip to content

Commit b0e9fe2

Browse files
committed
Fix test paths
1 parent f58d738 commit b0e9fe2

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

tests/e2e_tests.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import argparse
2-
import os
2+
from os import getcwd
3+
from os.path import dirname, abspath, join, realpath
34
import subprocess
45
from time import time
56
from rich.console import Console
67
import platform
78

8-
script_dir = os.path.dirname(os.path.abspath(__file__))
9-
run_dir = os.path.dirname(os.path.abspath(__file__))
9+
script_dir = dirname(abspath(__file__))
10+
run_dir = dirname(abspath(__file__))
1011

1112

1213
def get_cli_args():
@@ -82,14 +83,14 @@ def get_cli_args():
8283
"--test-user-file",
8384
dest="test_user_file",
8485
required=False,
85-
default="data/test_usernames.txt",
86+
default="tests/data/test_usernames.txt",
8687
help="Path to the file containing test usernames",
8788
)
8889
parser.add_argument(
8990
"--test-password-file",
9091
dest="test_password_file",
9192
required=False,
92-
default="data/test_passwords.txt",
93+
default="tests/data/test_passwords.txt",
9394
help="Path to the file containing test passwords",
9495
)
9596
parser.add_argument(
@@ -114,8 +115,8 @@ def parse_line_nums(value):
114115

115116
def generate_commands(args):
116117
lines = []
117-
file_loc = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
118-
commands_file = os.path.join(file_loc, "e2e_commands.txt")
118+
file_loc = realpath(join(getcwd(), dirname(__file__)))
119+
commands_file = join(file_loc, "e2e_commands.txt")
119120

120121
with open(commands_file) as file:
121122
if args.line_nums:
@@ -193,7 +194,7 @@ def run_e2e_tests(args):
193194
stdin=subprocess.PIPE,
194195
stdout=subprocess.PIPE,
195196
stderr=subprocess.STDOUT,
196-
cwd=os.path.dirname(__file__),
197+
cwd=abspath(join(dirname(__file__), "..")),
197198
)
198199

199200
# pass in a "y" for things that prompt for it (--ndts, etc)

0 commit comments

Comments
 (0)