Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed May 17, 2023
1 parent 8f2d795 commit eb3cde1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/database/test_database_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,10 @@ def add_items(self, formula):

class MostCommonPathTest(unittest.TestCase):
def test_most_common_path(self):
self.assertEqual(get_most_common_path(path="/a/b", reference_paths=["/a/b/c", "/a/d", "/a/b", "/a"]), "/a/b")
self.assertEqual(get_most_common_path(path="/a/b/f", reference_paths=["/a/b/c", "/a/d", "/a/b", "/a"]), "/a/b")
self.assertIsNone(get_most_common_path(path="/e/f", reference_paths=["/a/b/c", "/a/d", "/a/b", "/a"]))
self.assertEqual(get_most_common_path(path=os.path.join("a", "b"), reference_paths=[os.path.join("a", "b", "c"), os.path.join("a", "d"), os.path.join("a", "b"), os.path.join("a")]), os.path.join("a", "b"))
self.assertEqual(get_most_common_path(path=os.path.join("a", "b", "f"), reference_paths=[os.path.join("a", "b", "c"), os.path.join("a", "d"), os.path.join("a", "b"), os.path.join("a")]), os.path.join("a", "b"))
self.assertIsNone(get_most_common_path(path=os.path.join("e", "f"), reference_paths=[os.path.join("a", "b", "c"), os.path.join("a", "d"), os.path.join("a", "b"), os.path.join("a")]))


if __name__ == "__main__":
unittest.main()

0 comments on commit eb3cde1

Please sign in to comment.