Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gaogaotiantian committed Apr 23, 2024
1 parent 6e9483c commit d7b93ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ def __init__(self, name):
class FakeFrame:
def __init__(self, name):
self.f_code = FakeCode(name)
self.f_lineno = 1


class TestUtils(TestBase):
def test_get_dump_filename(self):
frame = FakeFrame("test_get_dump_filename")
filename = get_dump_filename(frame, None, None)
self.assertEqual(filename, os.path.abspath(filename))
self.assertIn("test_get_dump_filename", filename)
self.assertIn("test_get_dump_filename_1", filename)

filename = get_dump_filename(frame, "test.dump", None)
self.assertEqual(filename, os.path.abspath("test.dump"))
Expand All @@ -33,7 +34,7 @@ def test_get_dump_filename(self):

filename = get_dump_filename(frame, None, "dir")
self.assertEqual(filename, os.path.abspath(filename))
self.assertIn("test_get_dump_filename", filename)
self.assertIn("test_get_dump_filename_1", filename)
self.assertIn("dir", filename)

with self.assertRaises(ValueError):
Expand Down

0 comments on commit d7b93ff

Please sign in to comment.