tests: test schema name length check

This commit is contained in:
Benjamin Dauvergne 2020-06-03 10:07:42 +02:00
parent d9409b15bd
commit 579a118a5f
1 changed files with 13 additions and 0 deletions

13
tests/test_feeder.py Normal file
View File

@ -0,0 +1,13 @@
import pytest
from wcs_olap.feeder import WcsOlapFeeder
def test_constructor():
feeder = WcsOlapFeeder(api=None, pg_dsn='', schema='x' * 63)
schema_temp = feeder.ctx.as_dict()['schema_temp']
assert len(schema_temp) < 64
assert schema_temp == 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxedd110xxxxxxxxxxxxxxxxxxxxxxxx_temp'
with pytest.raises(ValueError):
feeder = WcsOlapFeeder(api=None, pg_dsn='', schema='x' * 64)