Skip to content

Commit

Permalink
Keep 'fixing' the test and run black
Browse files Browse the repository at this point in the history
  • Loading branch information
ptsavol committed Dec 17, 2024
1 parent e43afcd commit 9ff35dc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/tool/test_Tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,22 +198,28 @@ def test_find_input_files(self):
expected = {"input1.csv": [expected_urls["url1"], expected_urls["url3"]], "input2.csv": None}
self.assertEqual(2, len(result))
self.assertEqual(expected["input2.csv"], result["input2.csv"])
self.assertTrue(os.path.abspath(expected_urls["url3"]) in os.path.abspath(result["input1.csv"][0]) or os.path.abspath(expected_urls["url1"]) in os.path.abspath(result["input1.csv"][0]))
self.assertTrue(
os.path.abspath(expected_urls["url3"]) in os.path.abspath(result["input1.csv"][0])
or os.path.abspath(expected_urls["url1"]) in os.path.abspath(result["input1.csv"][0])
)
resources.pop(0)
resources.append(
ProjectItemResource("Exporter", "file", "fifth", url="file:///" + url5, metadata={}, filterable=False)
)
result = tool._find_input_files(resources)
expected = {"input2.csv": [expected_urls["url5"]], "input1.csv": [expected_urls["url3"]]}
expected = {
"input2.csv": [os.path.abspath(expected_urls["url5"])],
"input1.csv": [os.path.abspath(expected_urls["url3"])],
}
self.assertEqual(expected, result)
resources.append(
ProjectItemResource("Exporter", "file", "sixth", url="file:///" + url6, metadata={}, filterable=False)
)
tool.specification().inputfiles = set(["input2.csv", os.path.join(self._temp_dir.name, "input3.csv")])
result = tool._find_input_files(resources)
expected = {
os.path.join(self._temp_dir.name, "input3.csv"): [expected_urls["url6"]],
"input2.csv": [expected_urls["url5"]],
os.path.join(self._temp_dir.name, "input3.csv"): [os.path.abspath(expected_urls["url6"])],
"input2.csv": [os.path.abspath(expected_urls["url5"])],
}
self.assertEqual(expected, result)

Expand Down

0 comments on commit 9ff35dc

Please sign in to comment.