class ConflictHandlerTestCase(unittest.TestCase): def setUp(self): self.handler= ConflictHandler() def warnString(self): return ",".join( self.handler.warnings() ) def test_warnings(self): self.assertEqual( self.warnString(), "") self.handler.addWarning(ch.MISSING_LANDING_TIME) self.handler.addWarning(ch.MISSING_DEPARTURE_LOCATION) self.assertEqual( self.warnString(), "missing landing time" ",missing departure location") self.handler.disableWarning(ch.MISSING_DEPARTURE_LOCATION) self.assertEqual( self.warnString(), "missing landing time") self.handler.enableWarning(ch.MISSING_DEPARTURE_LOCATION) self.assertEqual( self.warnString(), "missing landing time" ",missing departure location")
def setUp(self): self.handler= ConflictHandler()