toxygen/tests/tests.py

19 lines
512 B
Python
Raw Normal View History

2018-05-23 18:23:51 +00:00
from middleware.tox_factory import *
2016-02-23 11:11:00 +00:00
2018-05-23 18:23:51 +00:00
# TODO: add new tests
2016-07-01 20:15:00 +00:00
class TestTox:
2016-02-23 11:11:00 +00:00
2016-03-06 12:44:52 +00:00
def test_creation(self):
2016-07-01 20:15:00 +00:00
name = b'Toxygen User'
status_message = b'Toxing on Toxygen'
2016-03-06 12:44:52 +00:00
tox = tox_factory()
tox.self_set_name(name)
tox.self_set_status_message(status_message)
data = tox.get_savedata()
del tox
2016-03-15 19:12:37 +00:00
tox = tox_factory(data)
2016-07-01 20:15:00 +00:00
assert tox.self_get_name() == str(name, 'utf-8')
assert tox.self_get_status_message() == str(status_message, 'utf-8')