Skip to content

Commit 2237ff0

Browse files
committed
fix: CI
1 parent b3a93a5 commit 2237ff0

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎src/scim2_sqlalchemy/comparison.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ def prepare(self, connection: Any) -> None:
111111
connection.create_function(_KEY_FUNCTION, 2, self.key, deterministic=True)
112112

113113
async def prepare_async(self, connection: Any) -> None:
114-
await connection.create_function(
115-
_KEY_FUNCTION, 2, self.key, deterministic=True
116-
)
114+
await connection.create_function(_KEY_FUNCTION, 2, self.key, deterministic=True)
117115

118116
def key(self, urn: str, value: Any) -> Any:
119117
if value is None:
@@ -124,7 +122,10 @@ def key(self, urn: str, value: Any) -> Any:
124122
return None
125123

126124
def column(self, column: _Column) -> ColumnElement[Any]:
127-
return getattr(func, _KEY_FUNCTION)(literal(column.binding.urn), column.compared) # type: ignore[no-any-return]
125+
key: ColumnElement[Any] = getattr(func, _KEY_FUNCTION)(
126+
literal(column.binding.urn), column.compared
127+
)
128+
return key
128129

129130
def operand(self, column: _Column, value: str) -> Any:
130131
return column.binding.comparable(value, self.policy)

‎tests/test_comparison.py‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,17 @@ def user_names(storage, resource_type, **parameters):
5050

5151
def test_a_decomposed_value_matches_its_composed_form(storage, user_type):
5252
"""Both sides are normalized to NFC, whatever form the value was written in."""
53-
storage.create(user_type, UserModel(user_name="José"))
53+
storage.create(user_type, UserModel(user_name="Jose\u0301"))
5454

55-
assert user_names(storage, user_type, filter='userName eq "José"') == [
56-
"José"
57-
]
55+
assert user_names(storage, user_type, filter='userName eq "José"') == ["Jose\u0301"]
5856

5957

6058
def test_a_decomposed_value_is_taken(storage, user_type):
6159
"""The uniqueness check compares the values in NFC."""
6260
storage.create(user_type, UserModel(user_name="José"))
6361

6462
with pytest.raises(UniquenessException):
65-
storage.create(user_type, UserModel(user_name="José"))
63+
storage.create(user_type, UserModel(user_name="Jose\u0301"))
6664

6765

6866
@pytest.mark.parametrize(
@@ -124,9 +122,7 @@ def test_sqlite_compares_with_the_key_of_the_policy(
124122
storage = storage_factory(provider=strict_provider)
125123
storage.create(user_type, UserModel(user_name="Straße"))
126124

127-
assert user_names(storage, user_type, filter='userName eq "STRASSE"') == [
128-
"Straße"
129-
]
125+
assert user_names(storage, user_type, filter='userName eq "STRASSE"') == ["Straße"]
130126
with pytest.raises(UniquenessException):
131127
storage.create(user_type, UserModel(user_name="strasse"))
132128

@@ -186,7 +182,10 @@ def test_a_database_without_the_key_warns(
186182
[
187183
('userName eq "A"', "lower(users.user_name) = lower('A')"),
188184
('externalId eq "A"', "users.external_id = 'A'"),
189-
('userName co "a%"', "lower(users.user_name) LIKE concat('%%', lower('a/%%'), '%%')"),
185+
(
186+
'userName co "a%"',
187+
"lower(users.user_name) LIKE concat('%%', lower('a/%%'), '%%')",
188+
),
190189
],
191190
)
192191
def test_another_database_lowers_both_sides(filter, expected):

0 commit comments

Comments
 (0)