def test_showMessage_should_call_xbmc_execute_builtin_correctly(self): sys.modules["__main__"].settings.getSetting.return_value = "3" utils = YouTubeUtils() utils.showMessage("someHeading","someMessage") sys.modules["__main__"].xbmc.executebuiltin.assert_called_with('XBMC.Notification("someHeading", "someMessage", 4000)')
def test_showMessage_should_call_xbmc_execute_builtin_correctly(self): sys.modules["__main__"].settings.getSetting.return_value = "3" utils = YouTubeUtils() utils.showMessage("someHeading", "someMessage") sys.modules["__main__"].xbmc.executebuiltin.assert_called_with( 'XBMC.Notification("someHeading", "someMessage", 4000)')
def test_showErrorMessage_should_call_showMessage_with_result(self): utils = YouTubeUtils() utils.showMessage = Mock() result = utils.showErrorMessage("someTitle","someResult", 303) utils.showMessage.assert_called_with("someTitle","someResult")
def test_showErrorMessage_should_call_showMessage_with_result(self): utils = YouTubeUtils() utils.showMessage = Mock() result = utils.showErrorMessage("someTitle", "someResult", 303) utils.showMessage.assert_called_with("someTitle", "someResult")
def test_showErrorMessage_should_call_showMessage_with_default(self): sys.modules["__main__"].language.return_value = "ERROR" utils = YouTubeUtils() utils.showMessage = Mock() result = utils.showErrorMessage("someTitle","someResult") utils.showMessage.assert_called_with("someTitle","ERROR")
def test_showErrorMessage_should_call_showMessage_with_default(self): sys.modules["__main__"].language.return_value = "ERROR" utils = YouTubeUtils() utils.showMessage = Mock() result = utils.showErrorMessage("someTitle", "someResult") utils.showMessage.assert_called_with("someTitle", "ERROR")
def test_showErrorMessage_should_call_showMessage_with_empty_title(self): sys.modules["__main__"].language.return_value = "ERROR" utils = YouTubeUtils() utils.showMessage = Mock() result = utils.showErrorMessage("","someResult", 303) utils.showMessage.assert_called_with("ERROR","someResult") sys.modules["__main__"].language.assert_called_with(30600)
def test_showErrorMessage_should_call_showMessage_with_empty_title(self): sys.modules["__main__"].language.return_value = "ERROR" utils = YouTubeUtils() utils.showMessage = Mock() result = utils.showErrorMessage("", "someResult", 303) utils.showMessage.assert_called_with("ERROR", "someResult") sys.modules["__main__"].language.assert_called_with(30600)