Skip to content

Commit

Permalink
Add some more open tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed May 12, 2023
1 parent bede5a8 commit d0c9a01
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_pyfileindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def test_project_single_empty_dir(self):
fi_with_filter_sub = self.fi_with_filter.open(p_name)
fi_without_filter_sub = self.fi_without_filter.open(p_name)
fi_debug_sub = self.fi_debug.open(p_name)
self.assertNotEqual(fi_with_filter_sub, self.fi_with_filter)
self.assertNotEqual(fi_without_filter_sub, self.fi_without_filter)
self.assertNotEqual(fi_debug_sub, self.fi_debug)
fi_with_filter_diff = list(
set(self.fi_with_filter.dataframe.path.values) - set(fi_with_filter_lst)
)
Expand Down Expand Up @@ -374,3 +377,11 @@ def test_open(self):
self.assertEqual(self.fi_with_filter.open(self.path), self.fi_with_filter)
self.assertEqual(self.fi_without_filter.open(self.path), self.fi_without_filter)
self.assertEqual(self.fi_debug.open(self.path), self.fi_debug)

def test_create_outside_directory(self):
p_name = os.path.join(self.path, "..", "test_different_dir")
os.makedirs(p_name)
self.assertNotEqual(self.fi_with_filter.open(p_name), self.fi_with_filter)
self.assertNotEqual(self.fi_without_filter.open(p_name), self.fi_without_filter)
self.assertNotEqual(self.fi_debug.open(p_name), self.fi_debug)
os.removedirs(p_name)

0 comments on commit d0c9a01

Please sign in to comment.