1
0
mirror of https://github.com/no2chem/wideq.git synced 2025-05-16 07:10:09 -07:00
wideq/tests/test_core.py
Aaron Godfrey 166af43277 Fixes the ReferenceValue type.
This type is a reference to another key at the root of the data.
Prior to this PR we were just storing the name and not the value that
the reference pointed to.
2019-07-02 14:53:20 -07:00

25 lines
655 B
Python

import unittest
import responses
import json
import wideq.core
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.core.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'}},
)