Skip to content

Commit

Permalink
Add test for fixed-width failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Argueta committed Sep 28, 2018
1 parent 67ef895 commit d72cddb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
(`Issue #140 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/140>`_)
- Add support for Parquet and ORC file formats in the COPY command
(`Issue #151 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/pull/150>`_)
- Add official support for Python 3.7


0.7.1 (2018-01-17)
Expand Down
14 changes: 14 additions & 0 deletions tests/test_copy_command.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
import sqlalchemy as sa
from sqlalchemy import exc as sa_exc

from sqlalchemy_redshift import dialect
from sqlalchemy_redshift import commands
Expand Down Expand Up @@ -134,6 +135,19 @@ def test_invalid_format():
)


def test_fixed_width_format_without_widths():
copy = dialect.CopyCommand(
tbl,
format=commands.Format.fixed_width,
data_location='s3://bucket',
access_key_id=access_key_id,
secret_access_key=secret_access_key
)
with pytest.raises(sa_exc.CompileError,
match=r"^'fixed_width' argument required.*$"):
compile_query(copy)


def test_compression():
expected_result = """
COPY schema1.t1 FROM 's3://mybucket/data/listing/'
Expand Down

0 comments on commit d72cddb

Please sign in to comment.