Ejemplo n.º 1
0
 def test_map_csv(self):
     from ichnaea.content.stats import map_csv
     session = self.db_master_session
     stats = [
         MapStat(lat=1000, lon=2000, value=101),
         MapStat(lat=2000, lon=3000, value=11),
         MapStat(lat=3000, lon=4000, value=1),
     ]
     session.add_all(stats)
     session.commit()
     result = map_csv(session)
     text = result.replace('\r', '').strip('\n')
     text = text.split('\n')
     self.assertEqual(text, ['lat,lon,value', '1.0,2.0,3', '2.0,3.0,2'])
Ejemplo n.º 2
0
 def test_map_csv(self):
     from ichnaea.content.stats import map_csv
     session = self.db_master_session
     stats = [
         MapStat(lat=1000, lon=2000, value=101),
         MapStat(lat=2000, lon=3000, value=11),
         MapStat(lat=3000, lon=4000, value=1),
     ]
     session.add_all(stats)
     session.commit()
     result = map_csv(session)
     text = result.replace('\r', '').strip('\n')
     text = text.split('\n')
     self.assertEqual(text, ['lat,lon,value', '1.0,2.0,3', '2.0,3.0,2'])
Ejemplo n.º 3
0
 def map_csv(self):
     session = self.request.db_slave_session
     return map_csv(session)
Ejemplo n.º 4
0
 def map_csv(self):
     session = self.request.db_slave_session
     return map_csv(session)