-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathmodels.py
39 lines (31 loc) · 1.02 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import unittest
from webexteamsbot.models import Response
class ModelTests(unittest.TestCase):
def test_response_text(self):
r = Response()
r.text = "hello"
self.assertEqual(r.text, "hello")
def test_response_files(self):
r = Response()
r.files = "someurl"
self.assertEqual(r.files[0], "someurl")
def test_response_roomid(self):
r = Response()
r.roomId = "someid"
self.assertEqual(r.roomId, "someid")
def test_response_markdown(self):
r = Response()
r.markdown = "**some markdown**"
self.assertEqual(r.markdown, "**some markdown**")
def test_response_html(self):
r = Response()
r.html = "<h1>some html</h1>"
self.assertEqual(r.html, "<h1>some html</h1>")
def test_response_json(self):
r = Response()
r.text = "foo"
self.assertIn("text", r.json())
def test_response_as_dict(self):
r = Response()
r.text = "foo"
self.assertIn("text", r.as_dict())