work around a bunch of bugs;

This commit is contained in:
Friedrich Lindenberg 2016-01-18 11:14:30 +01:00
parent b393ebb54a
commit 4f00db572f
3 changed files with 8 additions and 3 deletions

View File

@ -134,7 +134,7 @@ class Database(object):
""" """
Get a listing of all tables that exist in the database. Get a listing of all tables that exist in the database.
""" """
return self._tables.keys() return list(self._tables.keys())
def __contains__(self, member): def __contains__(self, member):
return member in self.tables return member in self.tables

View File

@ -253,6 +253,8 @@ class Table(object):
table.drop_column('created_at') table.drop_column('created_at')
""" """
if self.database.engine.dialect.name == 'sqlite':
raise NotImplementedError("SQLite does not support dropping columns.")
self._check_dropped() self._check_dropped()
self.database._acquire() self.database._acquire()
try: try:

View File

@ -315,8 +315,11 @@ class TableTestCase(unittest.TestCase):
assert 'date' in cols and 'temperature' in cols and 'place' in cols assert 'date' in cols and 'temperature' in cols and 'place' in cols
def test_drop_column(self): def test_drop_column(self):
try:
self.tbl.drop_column('date') self.tbl.drop_column('date')
assert 'date' not in self.tbl.columns assert 'date' not in self.tbl.columns
except NotImplementedError:
pass
def test_iter(self): def test_iter(self):
c = 0 c = 0