Skip to content

Commit

Permalink
Wip test files Class
Browse files Browse the repository at this point in the history
  • Loading branch information
erikamov committed Nov 16, 2024
1 parent a9a4168 commit 9be1c30
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions jobs/gtfs-rt-parser-v2/tests/test_gtfs_rt_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,28 @@ def test_no_output_file_for_vehicle_positions_on_validation():
# "WARNING: no validation output file found" was previously generating the error "[Errno 2] No such file or directory"
assert "WARNING: no validation output file found" in result.stdout
assert "saving 122 outcomes" in result.stdout


import os


class ResultsFinder:
def __init__(self, path):
self.path = path

def get_files(self):
return os.listdir(self.path) if os.path.isdir(self.path) else []


def test_results_finder_inexistent_path():
data_path = os.path.join(os.path.dirname(__file__), "xdata")
finder = ResultsFinder(data_path)

assert [] == finder.get_files()


def test_results_finder_returns_deduplicated_names():
data_path = os.path.join(os.path.dirname(__file__), "data")
finder = ResultsFinder(data_path)

assert ["test_1", "test_2.results.json", "test_3", "test_2"] == finder.get_files()

0 comments on commit 9be1c30

Please sign in to comment.