Skip to content

Commit 1422edb

Browse files
committed
test(sqlserver): add testsuite protocol decorator feature tests
1 parent c8c0452 commit 1422edb

3 files changed

Lines changed: 129 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# tests/rhosocial/activerecord_sqlserver_test/feature/conftest.py
2+
"""
3+
Pytest configuration for top-level feature tests.
4+
5+
Provides the `fixtures` / `async_fixtures` placeholders consumed by
6+
`test_features{,_async}.py`. The bodies of those tests are `assert True`,
7+
and the @requires_protocol / @requires_functions markers operate on the
8+
test's own requested fixtures (here only `fixtures`), so a stub is enough.
9+
"""
10+
11+
import pytest
12+
13+
14+
@pytest.fixture
15+
def fixtures():
16+
"""Stub fixture for the protocol/function decorator smoke tests."""
17+
return None
18+
19+
20+
@pytest.fixture
21+
async def async_fixtures():
22+
"""Async stub fixture for the protocol/function decorator smoke tests."""
23+
return None
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# src/rhosocial/activerecord/testsuite/feature/test_features.py
2+
"""Test the protocol-based requirement system."""
3+
4+
import pytest
5+
from rhosocial.activerecord.testsuite.utils import (
6+
requires_protocol,
7+
requires_functions,
8+
requires_window_functions,
9+
)
10+
11+
12+
class TestRequiresProtocolDecorator:
13+
"""Test the requires_protocol decorator functionality."""
14+
15+
def test_requires_protocol_decorator_basic(self):
16+
"""Test that requires_protocol decorator can be applied."""
17+
# This test just verifies the decorator can be applied
18+
assert True
19+
20+
def test_requires_protocol_with_method(self):
21+
"""Test requires_protocol with specific method name."""
22+
# This test verifies requires_protocol with method_name argument
23+
assert True
24+
25+
26+
class TestRequiresFunctionsDecorator:
27+
"""Test the requires_functions decorator functionality."""
28+
29+
@requires_functions('json_array_insert', 'jsonb_array_insert')
30+
def test_requires_functions_single(self, fixtures):
31+
"""Test requires_functions with single function."""
32+
# This test will be skipped if json_array_insert is not supported
33+
assert True
34+
35+
@requires_functions('json_array_insert')
36+
def test_requires_functions_multiple(self, fixtures):
37+
"""Test requires_functions with multiple functions."""
38+
# This test will be skipped if any required function is not supported
39+
assert True
40+
41+
42+
class TestConvenienceDecorators:
43+
"""Test convenience decorators."""
44+
45+
@requires_window_functions()
46+
def test_requires_window_functions(self, fixtures):
47+
"""Test requires_window_functions convenience decorator."""
48+
assert True
49+
50+
51+
if __name__ == "__main__":
52+
pytest.main([__file__, "-v"])
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# src/rhosocial/activerecord/testsuite/feature/test_features_async.py
2+
"""Test the protocol-based requirement system."""
3+
4+
import pytest
5+
from rhosocial.activerecord.testsuite.utils import (
6+
requires_protocol,
7+
requires_functions,
8+
requires_window_functions,
9+
)
10+
11+
12+
class TestAsyncRequiresProtocolDecorator:
13+
"""Test the requires_protocol decorator functionality."""
14+
15+
16+
async def test_requires_protocol_decorator_basic(self):
17+
"""Test that requires_protocol decorator can be applied."""
18+
# This test just verifies the decorator can be applied
19+
assert True
20+
21+
22+
async def test_requires_protocol_with_method(self):
23+
"""Test requires_protocol with specific method name."""
24+
# This test verifies requires_protocol with method_name argument
25+
assert True
26+
27+
28+
class TestAsyncRequiresFunctionsDecorator:
29+
"""Test the requires_functions decorator functionality."""
30+
31+
@requires_functions('json_array_insert', 'jsonb_array_insert')
32+
async def test_requires_functions_single(self, fixtures):
33+
"""Test requires_functions with single function."""
34+
# This test will be skipped if json_array_insert is not supported
35+
assert True
36+
37+
@requires_functions('json_array_insert')
38+
async def test_requires_functions_multiple(self, fixtures):
39+
"""Test requires_functions with multiple functions."""
40+
# This test will be skipped if any required function is not supported
41+
assert True
42+
43+
44+
class TestAsyncConvenienceDecorators:
45+
"""Test convenience decorators."""
46+
47+
@requires_window_functions()
48+
async def test_requires_window_functions(self, fixtures):
49+
"""Test requires_window_functions convenience decorator."""
50+
assert True
51+
52+
53+
if __name__ == "__main__":
54+
pytest.main([__file__, "-v"])

0 commit comments

Comments
 (0)