Passed
Push — master ( 272d30...b93c80 )
by Steffen
01:01
created

TestSticker   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 18
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A 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