Exemplo n.º 1
0
class MetaTest(TestCase):
    def setUp(self):
        self.stn_meta = WeaMeta("NNSC")

    def testWeaMetaInit(self):
        self.assertEquals("nnsc", self.stn_meta.stn_id)

    def testDateList(self):
        dates = self.stn_meta.get_date_list()
        self.assertTrue(len(dates) > 0)
        # make datetime objects for each (year, month) tuple
        for ym in dates:
            d = datetime.datetime(ym[0], ym[1], 1)

    def testLastestMonth(self):
        # This will fail if latest data files aren't available.
        today = datetime.date.today()
        last_date = self.stn_meta.get_latest_month()
        self.assertEquals(today.year, last_date.year)
        self.assertEquals(today.month, last_date.month)
Exemplo n.º 2
0
 def setUp(self):
     self.stn_meta = WeaMeta("NNSC")