def test_sql(self):
     mysession = Session()
     sheet = SQLTableReader(mysession, Pyexcel)
     data = sheet.to_array()
     content = [[]]
     # 'pyexcel' here is the table name
     assert list(data) == content
     mysession.close()
Beispiel #2
0
 def test_sql(self):
     mysession = Session()
     sheet = SQLTableReader(mysession, Pyexcel)
     data = sheet.to_array()
     content = [[]]
     # 'pyexcel'' here is the table name
     assert list(data) == content
     mysession.close()
 def test_sql_filter_1(self):
     mysession = Session()
     sheet = SQLTableReader(mysession, Pyexcel,
                            start_row=1, row_limit=1)
     data = sheet.to_array()
     content = [
         ['2014-11-11', 0, 'Adam', 11.25]
     ]
     # 'pyexcel'' here is the table name
     assert list(data) == content
     mysession.close()
Beispiel #4
0
 def test_sql_filter_1(self):
     mysession = Session()
     sheet = SQLTableReader(mysession, Pyexcel,
                            start_row=1, row_limit=1)
     data = sheet.to_array()
     content = [
         ['2014-11-11', 0, 'Adam', 11.25]
     ]
     # 'pyexcel'' here is the table name
     assert list(data) == content
     mysession.close()
 def test_sql_filter_2(self):
     mysession = Session()
     sheet = SQLTableReader(mysession, Pyexcel, start_column=1)
     data = sheet.to_array()
     content = [
         ['id', 'name', 'weight'],
         [0, 'Adam', 11.25],
         [1, 'Smith', 12.25]
     ]
     # 'pyexcel'' here is the table name
     assert list(data) == content
     mysession.close()
 def test_sql(self):
     mysession = Session()
     sheet = SQLTableReader(mysession, Pyexcel)
     data = sheet.to_array()
     content = [
         ['birth', 'id', 'name', 'weight'],
         ['2014-11-11', 0, 'Adam', 11.25],
         ['2014-11-12', 1, 'Smith', 12.25]
     ]
     # 'pyexcel' here is the table name
     assert list(data) == content
     mysession.close()
Beispiel #7
0
 def test_sql(self):
     mysession = Session()
     sheet = SQLTableReader(mysession, Pyexcel)
     data = sheet.to_array()
     content = [
         ['birth', 'id', 'name', 'weight'],
         ['2014-11-11', 0, 'Adam', 11.25],
         ['2014-11-12', 1, 'Smith', 12.25]
     ]
     # 'pyexcel' here is the table name
     assert list(data) == content
     mysession.close()
Beispiel #8
0
 def test_sql_filter_2(self):
     mysession = Session()
     sheet = SQLTableReader(mysession, Pyexcel, start_column=1)
     data = sheet.to_array()
     content = [
         ['id', 'name', 'weight'],
         [0, 'Adam', 11.25],
         [1, 'Smith', 12.25]
     ]
     # 'pyexcel'' here is the table name
     assert list(data) == content
     mysession.close()
 def test_sql_filter_3(self):
     mysession = Session()
     sheet = SQLTableReader(mysession, Pyexcel,
                            start_column=1, column_limit=1)
     data = sheet.to_array()
     content = [
         ['id'],
         [0],
         [1]
     ]
     # 'pyexcel'' here is the table name
     assert list(data) == content
     mysession.close()
Beispiel #10
0
 def test_sql_filter_3(self):
     mysession = Session()
     sheet = SQLTableReader(mysession, Pyexcel,
                            start_column=1, column_limit=1)
     data = sheet.to_array()
     content = [
         ['id'],
         [0],
         [1]
     ]
     # 'pyexcel'' here is the table name
     assert list(data) == content
     mysession.close()
    def test_sql_formating(self):
        mysession = Session()

        def custom_renderer(row):
            return [str(element) for element in row]
        # the key for this test case
        sheet = SQLTableReader(mysession, Pyexcel,
                               row_renderer=custom_renderer)
        data = sheet.to_array()
        content = [
            ['birth', 'id', 'name', 'weight'],
            ['2014-11-11', '0', 'Adam', '11.25'],
            ['2014-11-12', '1', 'Smith', '12.25']
        ]
        eq_(list(data), content)
        mysession.close()
Beispiel #12
0
    def test_sql_formating(self):
        mysession = Session()

        def custom_renderer(row):
            return [str(element) for element in row]
        # the key for this test case
        sheet = SQLTableReader(mysession, Pyexcel,
                               row_renderer=custom_renderer)
        data = sheet.to_array()
        content = [
            ['birth', 'id', 'name', 'weight'],
            ['2014-11-11', '0', 'Adam', '11.25'],
            ['2014-11-12', '1', 'Smith', '12.25']
        ]
        eq_(list(data), content)
        mysession.close()