Skip to content

Commit c025206

Browse files
committed
Add conformance test for root-level import
1 parent 8592441 commit c025206

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

test/test_compat.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import logging
2+
import os
3+
import sys
4+
import unittest
5+
6+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
7+
8+
import aurora_data_api
9+
from base import CoreAuroraDataAPITest, PEP249ConformanceTestMixin
10+
11+
logging.basicConfig(level=logging.INFO)
12+
logging.getLogger("aurora_data_api").setLevel(logging.DEBUG)
13+
logging.getLogger("urllib3.connectionpool").setLevel(logging.DEBUG)
14+
15+
16+
class TestAuroraDataAPIConformance(PEP249ConformanceTestMixin, CoreAuroraDataAPITest):
17+
"""Conformance test class for synchronous tests. Sets up connection to run tests."""
18+
19+
driver = aurora_data_api
20+
connection = None
21+
22+
def setUp(self):
23+
"""Setup mock objects for connection and cursor as member variables."""
24+
self.connection = self.driver.connect(
25+
database=self.db_name, aurora_cluster_arn=self.cluster_arn, secret_arn=self.secret_arn
26+
)
27+
28+
def test_cursor_interface(self):
29+
"""[Cursor] Runs formal interface checks on the cursor."""
30+
with self.connection.cursor() as cur:
31+
self._assert_cursor_interface(cur)
32+
33+
34+
# Remove these classes to avoid instantiation errors
35+
del CoreAuroraDataAPITest
36+
37+
38+
if __name__ == "__main__":
39+
unittest.main()

0 commit comments

Comments
 (0)