diff options
-rw-r--r-- | tests/test_highscores.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/test_highscores.py b/tests/test_highscores.py index 26545f0..048a42c 100644 --- a/tests/test_highscores.py +++ b/tests/test_highscores.py @@ -1,16 +1,14 @@ -import os +from pathlib import Path import unittest import pygame -from pathlib import Path - from sliceitoff.hiscores import HiScores class TestHiScores(unittest.TestCase): def setUp(self): - self.filename = "/tmp/sliceitoff-hiscores-test" - if os.path.isfile(self.filename): - os.remove(self.filename) + self.filename = Path("/tmp/sliceitoff-hiscores-test") + if self.filename.is_file(): + self.filename.unlink() self.hiscores = HiScores(filename = self.filename) def tearDown(self): @@ -18,15 +16,15 @@ class TestHiScores(unittest.TestCase): del self.hiscores except AttributeError: pass - if os.path.isfile(self.filename): - os.remove(self.filename) + if self.filename.is_file(): + self.filename.unlink() def test_can_create(self): self.assertNotEqual(None, self.hiscores) def test_config_file_is_created_on_exit(self): del self.hiscores - self.assertTrue(os.path.isfile(self.filename)) + self.assertTrue(self.filename.is_file()) def test_scores_can_be_added(self): self.hiscores.add(500_000,"HUH") |