mirror of
https://github.com/evennia/evennia.git
synced 2026-03-26 09:46:32 +01:00
Fix health bar unittest
This commit is contained in:
parent
1a7b596abc
commit
b0a71b8763
1 changed files with 15 additions and 2 deletions
|
|
@ -677,8 +677,21 @@ from evennia.contrib import health_bar
|
|||
|
||||
class TestHealthBar(EvenniaTest):
|
||||
def test_healthbar(self):
|
||||
expected_bar_str = "|[G|w |n|[B|w test24 / 200test |n"
|
||||
self.assertTrue(health_bar.display_meter(24, 200, length=40, pre_text="test", post_text="test", align="center") == expected_bar_str)
|
||||
expected_bar_str = '|[R|w|n|[B|w test0 / 200test |n'
|
||||
self.assertEqual(health_bar.display_meter(
|
||||
0, 200, length=40, pre_text="test", post_text="test", align="center"), expected_bar_str)
|
||||
expected_bar_str = "|[R|w |n|[B|w test24 / 200test |n"
|
||||
self.assertEqual(health_bar.display_meter(
|
||||
24, 200, length=40, pre_text="test", post_text="test", align="center"), expected_bar_str)
|
||||
expected_bar_str = '|[Y|w test100 /|n|[B|w 200test |n'
|
||||
self.assertEqual(health_bar.display_meter(
|
||||
100, 200, length=40, pre_text="test", post_text="test", align="center"), expected_bar_str)
|
||||
expected_bar_str = '|[G|w test180 / 200test |n|[B|w |n'
|
||||
self.assertEqual(health_bar.display_meter(
|
||||
180, 200, length=40, pre_text="test", post_text="test", align="center"), expected_bar_str)
|
||||
expected_bar_str = '|[G|w test200 / 200test |n|[B|w|n'
|
||||
self.assertEqual(health_bar.display_meter(
|
||||
200, 200, length=40, pre_text="test", post_text="test", align="center"), expected_bar_str)
|
||||
|
||||
# test mail contrib
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue