Skip to content

Commit b492cf4

Browse files
rename request cleaner script
1 parent 6725fa3 commit b492cf4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cads_broker/entry_points.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
@app.command()
15-
def remove_old_requests(
15+
def requests_cleaner(
1616
connection_string: Optional[str] = None, older_than_days: Optional[int] = 365
1717
) -> None:
1818
"""Remove records from the system_requests table older than `older_than_days`.

tests/test_90_entry_points.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def prepare_db(
135135
# not existing case of recent properties with old requests
136136

137137

138-
def test_remove_old_records(session_obj: sa.orm.sessionmaker):
138+
def test_requests_cleaner(session_obj: sa.orm.sessionmaker):
139139
connection_string = session_obj.kw["bind"].url
140140

141141
# test remove nothing, older_than_days=365 by default
@@ -146,7 +146,7 @@ def test_remove_old_records(session_obj: sa.orm.sessionmaker):
146146
)
147147
result = runner.invoke(
148148
entry_points.app,
149-
["remove-old-requests", "--connection-string", connection_string],
149+
["requests-cleaner", "--connection-string", connection_string],
150150
)
151151
assert result.exit_code == 0
152152
with session_obj() as session:
@@ -161,7 +161,7 @@ def test_remove_old_records(session_obj: sa.orm.sessionmaker):
161161
result = runner.invoke(
162162
entry_points.app,
163163
[
164-
"remove-old-requests",
164+
"requests-cleaner",
165165
"--connection-string",
166166
connection_string,
167167
"--older-than-days",
@@ -185,7 +185,7 @@ def test_remove_old_records(session_obj: sa.orm.sessionmaker):
185185
)
186186
result = runner.invoke(
187187
entry_points.app,
188-
["remove-old-requests", "--connection-string", connection_string],
188+
["requests-cleaner", "--connection-string", connection_string],
189189
)
190190
assert result.exit_code == 0
191191
with session_obj() as session:

0 commit comments

Comments
 (0)