def testModuleWithTrueShouldRunMethod(self): now = Now(tweak = "2015-01-01 12:00:00") self.assertTrue(chords.shouldRun( mockings.createModule( "ModuleWithTrueShouldRunMethod", "def shouldRun(now):\n\treturn True" ), now, mockings.getLogger() ))
def testModuleWithExceptionThrowingShouldRun(self): now = Now(tweak = "2015-01-01 12:00:00") self.assertFalse(chords.shouldRun( mockings.createModule( "ModuleWithExceptionThrowingShouldRun", "def shouldRun(now):\n\traise Exception('Something went wrong')" ), now, mockings.getLogger() ))
def testModuleWithoutShouldRunMethod(self): now = Now(tweak = "2015-01-01 12:00:00") self.assertFalse(chords.shouldRun( mockings.createModule( "WithoutShouldRunMethod", "def main():\n\tpass" ), now, mockings.getLogger() ))