예제 #1
0
    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
예제 #2
0
파일: beams.py 프로젝트: itrevex/adds
 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
예제 #3
0
    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