def test_showWarning(self): with mock.patch('builtins.print') as fake_print, \ mock.patch.object(Messages, 'promptUser') as fake_prompt: Messages.showWarning(mock.Mock()) fake_prompt.assert_called_once() assert fake_print.call_count == 3
def checkBuild(self): if self.build > Constants.CURRENT_BUILD: Messages.showError(MessageCodes.ERROR_LATER_VERSION) elif self.build < Constants.CURRENT_BUILD: Messages.showWarning(MessageCodes.WARNING_EARLIER_VERSION) else: #build number and file being run are compatible pass
def getSpanLinks(self, props, build): links = [] if (build < Constants.CURRENT_BUILD): return links try: links = props[Span.SPAN_LINKS] except KeyError: warning = MessageCodes.WARNING_NO_LINKS warning.setMsg(warning.msg%(self.beam_name, self.name)) Messages.showWarning(warning) return links