Ejemplo n.º 1
0
    def test_data_load_with_header(self):

        flatfile = FlatFile(self.Donkey,
                            "people",
                            "tests/new_people_with_header.csv")

        flatfile.load()


        result = self.session.query(self.Donkey.get_class("people")).filter_by(name = u"popph15").first()

        assert 1500 in [a.amount for a in result.donkey_sponsership]
Ejemplo n.º 2
0
def data_load_from_file(application, job_id, **kw):

    table = kw.get("table")
    file = kw.get("file")

    flatfile = FlatFile(application.database,
                        table,
                        util.get_dir(file))

    messager = Messager(application, job_id)

    return flatfile.load(messager = messager)