コード例 #1
0
ファイル: tests.py プロジェクト: nizox/PyBabe
 def test_pushpull(self):
     a  = Babe().pull(stream=StringIO(self.s2), format='csv', primary_key='rown')
     a = a.typedetect()
     a.push_mongo(db='pybabe_test',collection='test_pushpull', drop_collection=True)
     b = Babe().pull_mongo(db="pybabe_test", fields=['rown', 'f', 's'], collection='test_pushpull')
     buf = StringIO()
     b.push(stream=buf, format='csv')
     self.assertEquals(buf.getvalue(), self.s2)      
コード例 #2
0
 def test_pushpull(self):
     a = Babe().pull(stream=StringIO(self.s2),
                     format='csv',
                     primary_key='rown')
     a = a.typedetect()
     a.push_mongo(db='pybabe_test',
                  collection='test_pushpull',
                  drop_collection=True)
     b = Babe().pull_mongo(db="pybabe_test",
                           fields=['rown', 'f', 's'],
                           collection='test_pushpull')
     buf = StringIO()
     b.push(stream=buf, format='csv')
     self.assertEquals(buf.getvalue(), self.s2)
コード例 #3
0
 def test_pushpull(self):
     a = Babe().pull(string=self.s2, format="csv", primary_key="rown")
     a = a.typedetect()
     a.push_mongo(db="pybabe_test", collection="test_pushpull", drop_collection=True)
     b = Babe().pull_mongo(db="pybabe_test", fields=["rown", "f", "s"], collection="test_pushpull")
     self.assertEquals(b.to_string(), self.s2)
コード例 #4
0
 def test_push(self):
     a = Babe().pull(string=self.s1, format="csv", primary_key="rown")
     a = a.typedetect()
     a.push_mongo(db="pybabe_test", collection="test_push")
コード例 #5
0
 def test_push(self):
     a = Babe().pull(stream=StringIO(self.s1),
                     format='csv',
                     primary_key='rown')
     a = a.typedetect()
     a.push_mongo(db='pybabe_test', collection='test_push')
コード例 #6
0
ファイル: test_mongo.py プロジェクト: fdouetteau/PyBabe
 def test_push(self):
     a  = Babe().pull(string=self.s1, format='csv', primary_key='rown')
     a = a.typedetect()
     a.push_mongo(db='pybabe_test',collection='test_push')
コード例 #7
0
 def test_pushpull(self):
     a  = Babe().pull(string=self.s2, format='csv', primary_key='rown')
     a = a.typedetect()
     a.push_mongo(db='pybabe_test',collection='test_pushpull', drop_collection=True)
     b = Babe().pull_mongo(db="pybabe_test", fields=['rown', 'f', 's'], collection='test_pushpull')
     self.assertEquals(b.to_string(), self.s2)