Skip to content

Commit 9152d51

Browse files
author
Argon
committed
Updated random file path for new version of python.
1 parent dcbbf32 commit 9152d51

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Infrastructure/TipsManager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ def __init__(self, seed = None, root_directory=sys.argv[0]):
1212
random.seed(seed)
1313

1414
def get_random_tip(self):
15-
tips_folder = "Tips"
15+
tips_folder = self.root_directory+ "/Tips"
1616
random_file = random.choice(os.listdir("%s" % tips_folder))
17-
return "{}: {}" .format(random_file, TipsManager.random_line(PathUtility.normalize_path(tips_folder + "\\" + random_file,self.root_directory)))
17+
random_file_path = tips_folder + "\\" + random_file
18+
return "{}: {}" .format(random_file, TipsManager.random_line(random_file_path))
1819

1920
@staticmethod
2021
def random_line(file_name):

tests/Infrastructure/TipsManager/TestTipsManager.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
class TestsTipsManage(unittest.TestCase):
99
def test_random_tip_from_file(self):
1010
seed = 0
11-
print("!!!" , sys.path[1])
1211
tips_manager = TipsManager(seed,sys.path[1])
1312
result = tips_manager.get_random_tip()
1413
self.assertEqual(result, 'TestTips2.txt: Words\n')

0 commit comments

Comments
 (0)