Minor fixes
This commit is contained in:
parent
a17f2c8d5c
commit
28109d6826
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -49,7 +49,7 @@ jobs:
|
||||
make test
|
||||
- name: Run PostgreSQL tests
|
||||
env:
|
||||
DATABASE_URL: 'postgresql+psycopg2://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports[5432] }}/dataset'
|
||||
DATABASE_URL: 'postgresql://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports[5432] }}/dataset'
|
||||
run: |
|
||||
make test
|
||||
- name: Run MariaDB tests
|
||||
|
||||
2
setup.py
2
setup.py
@ -28,7 +28,7 @@ setup(
|
||||
namespace_packages=[],
|
||||
include_package_data=False,
|
||||
zip_safe=False,
|
||||
install_requires=["sqlalchemy >= 1.3.2", "alembic >= 0.6.2", "banal >= 1.0.1",],
|
||||
install_requires=["sqlalchemy >= 1.3.2", "alembic >= 0.6.2", "banal >= 1.0.1"],
|
||||
extras_require={
|
||||
"dev": [
|
||||
"pip",
|
||||
|
||||
@ -153,6 +153,7 @@ class TableTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.db = connect()
|
||||
self.tbl = self.db["weather"]
|
||||
self.tbl.delete()
|
||||
for row in TEST_DATA:
|
||||
self.tbl.insert(row)
|
||||
|
||||
@ -253,15 +254,9 @@ class TableTestCase(unittest.TestCase):
|
||||
|
||||
def test_cased_column_names(self):
|
||||
tbl = self.db["cased_column_names"]
|
||||
tbl.insert(
|
||||
{"place": "Berlin",}
|
||||
)
|
||||
tbl.insert(
|
||||
{"Place": "Berlin",}
|
||||
)
|
||||
tbl.insert(
|
||||
{"PLACE ": "Berlin",}
|
||||
)
|
||||
tbl.insert({"place": "Berlin"})
|
||||
tbl.insert({"Place": "Berlin"})
|
||||
tbl.insert({"PLACE ": "Berlin"})
|
||||
assert len(tbl.columns) == 2, tbl.columns
|
||||
assert len(list(tbl.find(Place="Berlin"))) == 3
|
||||
assert len(list(tbl.find(place="Berlin"))) == 3
|
||||
@ -391,14 +386,14 @@ class TableTestCase(unittest.TestCase):
|
||||
def test_insert_many(self):
|
||||
data = TEST_DATA * 100
|
||||
self.tbl.insert_many(data, chunk_size=13)
|
||||
assert len(self.tbl) == len(data) + 6
|
||||
assert len(self.tbl) == len(data)
|
||||
|
||||
def test_chunked_insert(self):
|
||||
data = TEST_DATA * 100
|
||||
with chunked.ChunkedInsert(self.tbl) as chunk_tbl:
|
||||
for item in data:
|
||||
chunk_tbl.insert(item)
|
||||
assert len(self.tbl) == len(data) + 6
|
||||
assert len(self.tbl) == len(data) + 6, (len(self.tbl), len(data))
|
||||
|
||||
def test_chunked_insert_callback(self):
|
||||
data = TEST_DATA * 100
|
||||
|
||||
Loading…
Reference in New Issue
Block a user