コード例 #1
0
ファイル: test_post.py プロジェクト: cjkrolak/radiotherm
 def test_creates_request(self):
     with patch(self._get_urlopen_import_path().replace(
             'urlopen', 'Request')) as mock_request:
         tstat = Thermostat(IP)
         tstat.post('/fake', POST_VALUE)
         mock_request.assert_called_once_with(URL, POST_VALUE,
                                              Thermostat.JSON_HEADER)
コード例 #2
0
ファイル: test_post.py プロジェクト: adamfazzari/radiotherm
 def test_creates_request(self):
     with patch(self._get_urlopen_import_path().replace('urlopen', 'Request')) as mock_request:
         tstat = Thermostat(IP)
         tstat.post('/fake', POST_VALUE)
         mock_request.assert_called_once_with(URL, POST_VALUE, Thermostat.JSON_HEADER)
コード例 #3
0
ファイル: test_post.py プロジェクト: cjkrolak/radiotherm
 def test_calls_urlopen(self):
     with patch(self._get_urlopen_import_path()) as mock_urlopen:
         tstat = Thermostat(IP)
         tstat.post('/fake', POST_VALUE)
         mock_urlopen.assert_called_once_with(FAKE_REQUEST, timeout=4)
コード例 #4
0
ファイル: test_post.py プロジェクト: adamfazzari/radiotherm
 def test_calls_urlopen(self):
     with patch(self._get_urlopen_import_path()) as mock_urlopen:
         tstat = Thermostat(IP)
         tstat.post('/fake', POST_VALUE)
         mock_urlopen.assert_called_once_with(FAKE_REQUEST)