Beispiel #1
0
	def testModuleWithoutRequirements(self):
		now = Now(tweak = "2015-01-01 12:00:00")
		self.assertFalse(chords.requiresVirtualEnv(
			mockings.createModule(
				"WithRequirements",
				"def main():\n\tpass"
			)
		))
Beispiel #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()
		))
Beispiel #3
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()
		))
Beispiel #4
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()
		))