Skip to content

Commit

Permalink
cache_test: Test that get_file can take _FileMemo as input
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Silver committed Jan 20, 2025
1 parent 8d7b3bf commit 42fb8c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions beangulp/cache_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def test_cache(self):
self.assertEqual('abc', wrap.convert(converter))
self.assertEqual(1, converter.call_count)

# Check that get_file can be called on a _FileMemo.
self.assertNotEqual(wrap, cache.get_file(tmpfile.name))
self.assertNotEqual(wrap, cache.get_file(wrap))
self.assertEqual(wrap.name, cache.get_file(tmpfile.name).name)
self.assertEqual(wrap.name, cache.get_file(wrap).name)

def test_cache_head_and_contents(self):
with tempfile.NamedTemporaryFile(suffix='.py') as tmpfile:
shutil.copy(__file__, tmpfile.name)
Expand Down

0 comments on commit 42fb8c7

Please sign in to comment.