-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_init.py
More file actions
117 lines (96 loc) · 3.6 KB
/
test_init.py
File metadata and controls
117 lines (96 loc) · 3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
"""Unit tests for pysqlit/__init__.py module."""
import pytest
from pysqlit import (
EnhancedDatabase,
EnhancedREPL,
TransactionManager,
IsolationLevel,
BackupManager,
DDLManager,
Row,
DataType,
TableSchema,
ColumnDefinition
)
class TestInit:
"""Test cases for pysqlit package initialization."""
def test_import_enhanced_database(self):
"""Test EnhancedDatabase can be imported."""
assert EnhancedDatabase is not None
assert callable(EnhancedDatabase)
def test_import_enhanced_repl(self):
"""Test EnhancedREPL can be imported."""
assert EnhancedREPL is not None
assert callable(EnhancedREPL)
def test_import_transaction_manager(self):
"""Test TransactionManager can be imported."""
assert TransactionManager is not None
assert callable(TransactionManager)
def test_import_isolation_level(self):
"""Test IsolationLevel can be imported."""
assert IsolationLevel is not None
assert hasattr(IsolationLevel, 'READ_UNCOMMITTED')
assert hasattr(IsolationLevel, 'READ_COMMITTED')
assert hasattr(IsolationLevel, 'REPEATABLE_READ')
assert hasattr(IsolationLevel, 'SERIALIZABLE')
def test_import_backup_manager(self):
"""Test BackupManager can be imported."""
assert BackupManager is not None
assert callable(BackupManager)
def test_import_ddl_manager(self):
"""Test DDLManager can be imported."""
assert DDLManager is not None
assert callable(DDLManager)
def test_import_row(self):
"""Test Row can be imported."""
assert Row is not None
assert callable(Row)
def test_import_data_type(self):
"""Test DataType can be imported."""
assert DataType is not None
assert hasattr(DataType, 'INTEGER')
assert hasattr(DataType, 'TEXT')
assert hasattr(DataType, 'REAL')
assert hasattr(DataType, 'BLOB')
assert hasattr(DataType, 'NULL')
def test_import_table_schema(self):
"""Test TableSchema can be imported."""
assert TableSchema is not None
assert callable(TableSchema)
def test_import_column_definition(self):
"""Test ColumnDefinition can be imported."""
assert ColumnDefinition is not None
assert callable(ColumnDefinition)
def test_all_exports(self):
"""Test __all__ contains expected exports."""
import pysqlit
expected_exports = [
"EnhancedDatabase",
"EnhancedREPL",
"TransactionManager",
"IsolationLevel",
"BackupManager",
"DDLManager",
"Row",
"DataType",
"TableSchema",
"ColumnDefinition"
]
for export in expected_exports:
assert hasattr(pysqlit, export)
assert export in pysqlit.__all__
def test_version_info(self):
"""Test version information is available."""
import pysqlit
assert hasattr(pysqlit, '__version__')
assert hasattr(pysqlit, '__author__')
assert pysqlit.__version__ == "1.0.0"
assert pysqlit.__author__ == "PySQLit Team"
def test_package_initialization(self):
"""Test package can be imported without errors."""
import pysqlit
# Should not raise any exceptions
assert pysqlit is not None
# Check that it's a proper package
assert hasattr(pysqlit, '__path__')
assert hasattr(pysqlit, '__file__')