|
88 | 88 | from sqlalchemy.testing.suite.test_types import BooleanTest as _BooleanTest
|
89 | 89 | from sqlalchemy.testing.suite.test_types import IntegerTest as _IntegerTest
|
90 | 90 | from sqlalchemy.testing.suite.test_types import StringTest as _StringTest
|
91 |
| - |
| 91 | +from sqlalchemy.testing.suite.test_types import TextTest as _TextTest |
92 | 92 | from sqlalchemy.testing.suite.test_types import _LiteralRoundTripFixture
|
93 | 93 |
|
94 | 94 | from sqlalchemy.testing.suite.test_types import ( # noqa: F401, F403
|
@@ -873,3 +873,57 @@ class StringTest(_StringTest):
|
873 | 873 | @pytest.mark.skip("Spanner doesn't support non-ascii characters")
|
874 | 874 | def test_literal_non_ascii(self):
|
875 | 875 | pass
|
| 876 | + |
| 877 | + |
| 878 | +class TextTest(_TextTest): |
| 879 | + def test_text_empty_strings(self, connection): |
| 880 | + """ |
| 881 | + SPANNER OVERRIDE: |
| 882 | +
|
| 883 | + Cloud Spanner doesn't support the tables with an empty primary key |
| 884 | + when column has defined NOT NULL - following insertions will fail with |
| 885 | + `400 id must not be NULL in table date_table`. |
| 886 | + Overriding the tests and adding a manual primary key value to avoid the same |
| 887 | + failures. |
| 888 | + """ |
| 889 | + text_table = self.tables.text_table |
| 890 | + |
| 891 | + connection.execute(text_table.insert(), {"id": 1, "text_data": ""}) |
| 892 | + row = connection.execute(select([text_table.c.text_data])).first() |
| 893 | + eq_(row, ("",)) |
| 894 | + |
| 895 | + def test_text_null_strings(self, connection): |
| 896 | + """ |
| 897 | + SPANNER OVERRIDE: |
| 898 | +
|
| 899 | + Cloud Spanner doesn't support the tables with an empty primary key |
| 900 | + when column has defined NOT NULL - following insertions will fail with |
| 901 | + `400 id must not be NULL in table date_table`. |
| 902 | + Overriding the tests and adding a manual primary key value to avoid the same |
| 903 | + failures. |
| 904 | + """ |
| 905 | + text_table = self.tables.text_table |
| 906 | + |
| 907 | + connection.execute(text_table.insert(), {"id": 1, "text_data": None}) |
| 908 | + row = connection.execute(select([text_table.c.text_data])).first() |
| 909 | + eq_(row, (None,)) |
| 910 | + |
| 911 | + @pytest.mark.skip("Spanner doesn't support non-ascii characters") |
| 912 | + def test_literal_non_ascii(self): |
| 913 | + pass |
| 914 | + |
| 915 | + def test_text_roundtrip(self): |
| 916 | + """ |
| 917 | + SPANNER OVERRIDE: |
| 918 | +
|
| 919 | + Cloud Spanner doesn't support the tables with an empty primary key |
| 920 | + when column has defined NOT NULL - following insertions will fail with |
| 921 | + `400 id must not be NULL in table date_table`. |
| 922 | + Overriding the tests and adding a manual primary key value to avoid the same |
| 923 | + failures. |
| 924 | + """ |
| 925 | + text_table = self.tables.text_table |
| 926 | + |
| 927 | + config.db.execute(text_table.insert(), {"id": 1, "text_data": "some text"}) |
| 928 | + row = config.db.execute(select([text_table.c.text_data])).first() |
| 929 | + eq_(row, ("some text",)) |
0 commit comments