Exemplo n.º 1
0
	def testInvalidYear(self):
		try:
			date = EVChartMacro.getDateFromTicket("20a2-01-01", 1)
		except:
			pass
		else:
			self.fail("Error expected")
Exemplo n.º 2
0
	def testInvalidFormat(self):
		try:
			date = EVChartMacro.getDateFromTicket("01-01-2012", 1)
		except:
			pass
		else:
			self.fail("Error expected")
Exemplo n.º 3
0
	def testInvalidMonth(self):
		try:
			date = EVChartMacro.getDateFromTicket("2012-13-01", 1)
		except:
			pass
		else:
			self.fail("Error expected")
Exemplo n.º 4
0
	def testDateStringTooSmall(self):
		try:
			date = EVChartMacro.getDateFromTicket("2012-01-1", 1)
		except:
			pass
		else:
			self.fail("Error expected")
Exemplo n.º 5
0
	def testValidDate(self):
		date = EVChartMacro.getDateFromTicket("2012-01-01", 1)
		assert date.day == 1, 'Incorrect day'
		assert date.month == 1, 'Incorrect month'
		assert date.year == 2012, 'Incorrect year'