예제 #1
0
파일: test-db.py 프로젝트: ARPA-SIMC/dballe
 def testQueryVolnd(self):
     from testlib import fill_volnd
     self.db.reset()
     fill_volnd(self.db)
     query = dballe.Record()
     query["var"] = "B10004"
     query["datetime"] = datetime.datetime(2007, 1, 1, 0, 0, 0)
     reports = []
     for cur in self.db.query_data(query):
         reports.append(cur["rep_memo"])
     s = "synop"
     t = "temp"
     self.assertEqual(reports, [s, t, s, t, s, t, s, s, t, s, t])
예제 #2
0
 def testQueryVolnd(self):
     from testlib import fill_volnd
     self.db.remove_all()
     with self.transaction() as tr:
         fill_volnd(tr)
     query = {}
     query["var"] = "B10004"
     query["datetime"] = datetime.datetime(2007, 1, 1, 0, 0, 0)
     reports = []
     with self.deprecated_on_db():
         for cur in self.db.query_data(query):
             reports.append(cur["rep_memo"])
     s = "synop"
     t = "temp"
     self.assertEqual(reports, [s, s, s, s, s, s, t, t, t, t, t])
예제 #3
0
 def setUp(self):
     super(CSVMixin, self).setUp()
     from testlib import fill_volnd
     with self.db.transaction() as tr:
         fill_volnd(tr)
예제 #4
0
    def setUp(self):
        from testlib import fill_volnd

        numpy.seterr(divide="raise", over="raise", under="raise", invalid="raise")
        self.db = dballe.DB.connect_test()
        fill_volnd(self.db)
예제 #5
0
 def setUp(self):
     from testlib import fill_volnd
     self.db = dballe.DB.connect_test()
     fill_volnd(self.db)