def test_sql(self): sheet = pe.load_from_sql(Session(), Pyexcel) content = dedent(""" pyexcel: +------------+----+-------+--------+ | birth | id | name | weight | +------------+----+-------+--------+ | 2014-11-11 | 0 | Adam | 11.25 | +------------+----+-------+--------+ | 2014-11-12 | 1 | Smith | 12.25 | +------------+----+-------+--------+""").strip('\n') self.assertEqual(str(sheet), content)
def test_sql(self): sheet = pe.load_from_sql(Session(), Pyexcel) content = dedent(""" Sheet Name: pyexcel +------------+----+-------+--------+ | birth | id | name | weight | +------------+----+-------+--------+ | 2014-11-11 | 0 | Adam | 11.250 | +------------+----+-------+--------+ | 2014-11-12 | 1 | Smith | 12.250 | +------------+----+-------+--------+""").strip('\n') assert str(sheet) == content
def test_empty_table(self): sheet = pe.load_from_sql(Session(), Pyexcel) assert sheet is not None