Completed
Push — master ( 72b331...d4b7d2 )
by Steffen
02:14
created

tests.watcher.adapters.models.test_sticker   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 15
dl 0
loc 34
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A TestSticker.test_sticker() 0 13 1
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