Add unit tests for health_bar contrib
This commit is contained in:
parent
9ab3d27875
commit
8d5e167a8d
1 changed files with 9 additions and 0 deletions
|
|
@ -652,6 +652,15 @@ class TestGenderSub(CommandTest):
|
||||||
txt = "Test |p gender"
|
txt = "Test |p gender"
|
||||||
self.assertEqual(gendersub._RE_GENDER_PRONOUN.sub(char._get_pronoun, txt), "Test their gender")
|
self.assertEqual(gendersub._RE_GENDER_PRONOUN.sub(char._get_pronoun, txt), "Test their gender")
|
||||||
|
|
||||||
|
# test health bar contrib
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
# test mail contrib
|
# test mail contrib
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue