1
0
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:
Adrian Sampson 2019-06-30 11:02:48 -04:00
parent 195cb50452
commit 90fc21a351
3 changed files with 29 additions and 2 deletions

View File

@ -12,3 +12,8 @@ requires = [
]
description-file = "README.md"
requires-python = ">=3.4"
[tool.flit.metadata.requires-extra]
test = [
"responses"
]

View File

@ -1,2 +1,23 @@
def test_simple():
assert True
import unittest
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'}},
)

View File

@ -3,6 +3,7 @@ envlist = py34,py35,py36,py37,flake8,coverage
isolated_build = True
[testenv]
extras = test
commands =
python -m unittest {posargs} discover -s tests