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