Total Complexity | 1 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # !/usr/bin/python |
||
2 | # -*- coding: utf-8 -*- |
||
3 | import json |
||
4 | import unittest |
||
5 | |||
6 | from kuon.api_response import APIResponse |
||
7 | from kuon.watcher.adapters.models.sticker import Sticker |
||
8 | |||
9 | |||
10 | class TestSticker(unittest.TestCase): |
||
11 | """Test cases for the sticker model""" |
||
12 | |||
13 | def test_sticker(self) -> None: |
||
14 | """Test the conversion to the APIResponse object and the json.dumps |
||
15 | |||
16 | :return: |
||
17 | """ |
||
18 | sticker = Sticker( |
||
19 | name="Howling Dawn", |
||
20 | image="some_sticker_image_link", |
||
21 | wear_value=0.43092 |
||
22 | ) |
||
23 | |||
24 | # assert that all values can get loaded properly and parsed to APIResponse objects |
||
25 | self.assertEqual(str(sticker), str(APIResponse(json.dumps(sticker.__dict__)))) |
||
26 | |||
27 | |||
28 | if __name__ == '__main__': |
||
29 | suite = unittest.TestLoader().loadTestsFromTestCase(TestSticker) |
||
30 | unittest.TextTestRunner(verbosity=2).run(suite) |
||
31 |