Ejemplo n.º 1
0
	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()
		))
Ejemplo n.º 2
0
	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()
		))
Ejemplo n.º 3
0
	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()
		))