Exemplo n.º 1
0
	def test_days(self):
		e = Event(1.0, 2.0, 'Monday', 1)
		self.assertEqual(e.day, 'Monday')
		e.day = 'Tuesday'
		self.assertEqual(e.day, 'Tuesday')
		e.day = 'Wednesday'
		self.assertEqual(e.day, 'Wednesday')
		e.day = 'Thursday'
		self.assertEqual(e.day, 'Thursday')
		e.day = 'Friday'
		self.assertEqual(e.day, 'Friday')
		e.day = 'Saturday'
		self.assertEqual(e.day, 'Saturday')
		e.day = 'Sunday'
		self.assertEqual(e.day, 'Sunday')

		with self.assertRaises(ValueError):
			e.day = 'Funday'
		self.assertEqual(e.day,'Sunday')