def showWarning(self, pt2, pt4, pt3, pt6, pt7, pt8, left_section, right_section): #check to see if left section is deeper than beam if pt2[EntityLine.Y] > pt4[EntityLine.Y] or \ pt3[EntityLine.Y] > pt4[EntityLine.Y]: warning = MessageCodes.WARNING_DEEPER_SECTION warning.setMsg(warning.msg % (left_section.name)) Messages.w(warning) #check to see if right section is deeper than beam if pt6[EntityLine.Y] > pt8[EntityLine.Y] or \ pt7[EntityLine.Y] > pt8[EntityLine.Y]: warning = MessageCodes.WARNING_DEEPER_SECTION warning.setMsg(warning.msg % (right_section.name)) Messages.w(warning)
def test_w(self): with mock.patch('builtins.print') as fake_print: Messages.w(mock.Mock()) assert fake_print.call_count == 4