style: formater le depot avec ruff format
QUA-002, premiere moitie. **Ce commit ne fait que reformater** : aucun changement de comportement, aucune ligne de logique touchee. 72 fichiers, 4 restaient deja conformes. Il est isole exprès, pour que `git log -p` sur les commits voisins reste lisible. `quote-style = "preserve"` etait deja pose dans pyproject.toml, ce qui evite le brassage guillemets simples / doubles : le diff porte sur les retours a la ligne, l indentation des appels longs et les virgules finales, pas sur le style de chaine. Verification : 263 tests passent avant et apres, ruff check propre. L activation en CI arrive dans le commit suivant, separement, pour que ce diff-ci ne contienne rien d autre. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
+17
-11
@@ -19,23 +19,29 @@ from app.app import normalise_database_url
|
||||
|
||||
|
||||
class TestNormalisation:
|
||||
@pytest.mark.parametrize('given', [
|
||||
'postgresql://user:pass@host:5432/tryouts',
|
||||
'postgres://user:pass@host:5432/tryouts',
|
||||
])
|
||||
@pytest.mark.parametrize(
|
||||
'given',
|
||||
[
|
||||
'postgresql://user:pass@host:5432/tryouts',
|
||||
'postgres://user:pass@host:5432/tryouts',
|
||||
],
|
||||
)
|
||||
def test_a_driverless_postgres_url_gets_psycopg(self, given):
|
||||
assert normalise_database_url(given).startswith('postgresql+psycopg://')
|
||||
|
||||
def test_the_rest_of_the_url_is_untouched(self):
|
||||
result = normalise_database_url(
|
||||
'postgresql://u:p%40s[email protected]:5432/tryouts?sslmode=require')
|
||||
assert result == (
|
||||
'postgresql+psycopg://u:p%40s[email protected]:5432/tryouts?sslmode=require')
|
||||
'postgresql://u:p%40s[email protected]:5432/tryouts?sslmode=require'
|
||||
)
|
||||
assert result == ('postgresql+psycopg://u:p%40s[email protected]:5432/tryouts?sslmode=require')
|
||||
|
||||
@pytest.mark.parametrize('given', [
|
||||
'postgresql+psycopg://user:pass@host/db',
|
||||
'postgresql+psycopg2://user:pass@host/db',
|
||||
])
|
||||
@pytest.mark.parametrize(
|
||||
'given',
|
||||
[
|
||||
'postgresql+psycopg://user:pass@host/db',
|
||||
'postgresql+psycopg2://user:pass@host/db',
|
||||
],
|
||||
)
|
||||
def test_an_explicit_driver_is_left_alone(self, given):
|
||||
"""Naming psycopg2 stays possible for an environment that has it."""
|
||||
assert normalise_database_url(given) == given
|
||||
|
||||
Reference in New Issue
Block a user