def test_get_use_inputstream_high_inputstream(self, mock_executeJSONRPC, mock_executeJSONRPC2): mock_executeJSONRPC.return_value = '{"result": {"version": {"major": 18}}}' mock_executeJSONRPC2.return_value = '{"result": {"addon": {"enabled": true, "version": "12.1.7"}}}' utils = Utils(kodi_base_url='/foo/', constants=Constants()) self.assertEquals( first=utils.use_inputstream(), second=False)
def test_get_use_inputstream_low_inputstream(self, mock_executeJSONRPC): mock_executeJSONRPC.return_value = '{"result": {"version": {"major": 18}}}' utils = Utils(kodi_base_url='/foo/', constants=Constants()) def return_low_version(): return '0.9.9' utils.get_inputstream_version = return_low_version self.assertEquals( first=utils.use_inputstream(), second=False)
def test_get_use_inputstream_setting_off(self, mock_xbmcaddon): mock_xbmcaddon.return_value = MockAddon() utils = Utils(kodi_base_url='/foo/', constants=Constants()) self.assertEquals( first=utils.use_inputstream(), second=False)
def test_get_use_inputstream_error(self, mock_executeJSONRPC): mock_executeJSONRPC.return_value = '{"error": true}' utils = Utils(kodi_base_url='/foo/', constants=Constants()) self.assertEquals( first=utils.use_inputstream(), second=False)