From 43e1a7425e525a1da0c805db16a2c54b56fc1580 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Wed, 10 Apr 2024 17:00:23 +0300 Subject: tests for statusline --- tests/test_status.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/test_status.py (limited to 'tests') diff --git a/tests/test_status.py b/tests/test_status.py new file mode 100644 index 0000000..a365ea6 --- /dev/null +++ b/tests/test_status.py @@ -0,0 +1,23 @@ +import unittest +import pygame + +from pathlib import Path + +from sliceitoff.stats import Stats +from sliceitoff.status import Status + +class TestStatus(unittest.TestCase): + def setUp(self): + self.stats = Stats() + self.status = Status( stats = self.stats) + + def test_can_create(self): + self.assertNotEqual(None, self.status) + + def test_updating_without_crash(self): + for _ in range(100): + self.status.update(dt=100) + for _ in range(100): + self.stats.add_score(100) + self.stats.percent -= 1 + self.status.update(dt=100) -- cgit v1.2.3