mirror of
https://github.com/no2chem/wideq.git
synced 2025-05-18 08:10:17 -07:00
Actually test something
This commit is contained in:
parent
195cb50452
commit
90fc21a351
@ -12,3 +12,8 @@ requires = [
|
|||||||
]
|
]
|
||||||
description-file = "README.md"
|
description-file = "README.md"
|
||||||
requires-python = ">=3.4"
|
requires-python = ">=3.4"
|
||||||
|
|
||||||
|
[tool.flit.metadata.requires-extra]
|
||||||
|
test = [
|
||||||
|
"responses"
|
||||||
|
]
|
||||||
|
@ -1,2 +1,23 @@
|
|||||||
def test_simple():
|
import unittest
|
||||||
assert True
|
import wideq
|
||||||
|
import responses
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
class SimpleTest(unittest.TestCase):
|
||||||
|
@responses.activate
|
||||||
|
def test_gateway_info(self):
|
||||||
|
responses.add(
|
||||||
|
responses.POST,
|
||||||
|
'https://kic.lgthinq.com:46030/api/common/gatewayUriList',
|
||||||
|
json={'lgedmRoot': 'foo'},
|
||||||
|
)
|
||||||
|
|
||||||
|
data = wideq.gateway_info('COUNTRY', 'LANGUAGE')
|
||||||
|
self.assertEqual(data, 'foo')
|
||||||
|
|
||||||
|
self.assertEqual(len(responses.calls), 1)
|
||||||
|
self.assertEqual(
|
||||||
|
json.loads(responses.calls[0].request.body),
|
||||||
|
{'lgedmRoot': {'countryCode': 'COUNTRY', 'langCode': 'LANGUAGE'}},
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user