コード例 #1
0
 def testReaderConverter(self):
     json = reader.Reader("fake file")
     clubName = json.convertTeamName("Man Utd")
     self.assertEqual("MANUTD", clubName)
コード例 #2
0
 def test_date_conversion_form_bad_format(self):
     baseReader = reader.Reader("")
     test_date = "xxxxxx"
     # pyDate = baseReader.convertStrDate(test_date)
     self.assertRaises(AttributeError, baseReader.convertStrDate, test_date)
コード例 #3
0
 def test_date_conversion_ddmmyy(self):
     baseReader = reader.Reader("")
     test_date = "11/05/02"
     pyDate = baseReader.convertStrDate(test_date)
     self.assertIsNotNone(pyDate)
     self.assertEqual(datetime.date(2002, 5, 11), pyDate)
コード例 #4
0
 def test_date_conversion_ddmmyyyy(self):
     baseReader = reader.Reader("")
     test_date = "21/04/2003"
     pyDate = baseReader.convertStrDate(test_date)
     self.assertIsNotNone(pyDate)
     self.assertEqual(datetime.date(2003, 4, 21), pyDate)
コード例 #5
0
 def test_date_conversion_form_two(self):
     baseReader = reader.Reader("")
     test_date = "15/08/98"
     pyDate = baseReader.convertStrDate(test_date)
     self.assertIsNotNone(pyDate)
     self.assertEqual(datetime.date(1998, 8, 15), pyDate)
コード例 #6
0
 def test_date_conversion_form_two(self):
     baseReader = reader.Reader("")
     test_date = "2000-12-13"
     pyDate = baseReader.convertStrDate(test_date)
     self.assertIsNotNone(pyDate)
     self.assertEqual(datetime.date(2000, 12, 13), pyDate)