Unit tests for the DB connection layer and Tinker error paths (coverage 95% without MariaDB)
CI / Lint (flake8, house style) (pull_request) Successful in 2m14s
CI / Test (pytest) (pull_request) Canceled after 0s
CI / Integration (MariaDB) (pull_request) Canceled after 0s
CI / Security (bandit, pip-audit) (pull_request) Canceled after 0s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Canceled after 0s
CI / Deploy (pull_request) Canceled after 0s
CI / Lint (flake8, house style) (pull_request) Successful in 2m14s
CI / Test (pytest) (pull_request) Canceled after 0s
CI / Integration (MariaDB) (pull_request) Canceled after 0s
CI / Security (bandit, pip-audit) (pull_request) Canceled after 0s
CI / Scan (secrets, workflows, shell, patterns) (pull_request) Canceled after 0s
CI / Deploy (pull_request) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
379570bbdc
commit
b0e240af50
2 files changed
+153
No files matched your search
@@ -216,3 +216,21 @@ def test_backoff():
|
||||
assert backoff_s(1) == 120
|
||||
assert backoff_s(3) == 480
|
||||
assert backoff_s(50) == 3600
|
||||
|
||||
|
||||
def test_tinker_network_errors_and_unknown_reads():
|
||||
down = FakeSession().add('POST', TINKER, requests.ConnectionError('x')).add(
|
||||
'GET', 'https://t/api/tickets_api.php', requests.ConnectionError('x'))
|
||||
t = TinkerClient(TINKER, 'k', session=down)
|
||||
r = t.create(title='t', description='', priority=3, category='c', ticket_type='Issue', dedup_key='k')
|
||||
assert not r.ok and r.ticket_id is None and 'x' in r.error
|
||||
assert t.open_tickets() is None
|
||||
assert t.ticket('1') is None
|
||||
assert 'TicketResult' in repr(r)
|
||||
refused = FakeSession().add('POST', 'https://t/api/ticket_comment_api.php', FakeResponse(401, {}))
|
||||
assert TinkerClient(TINKER, 'k', session=refused).comment('1', 'x') is False
|
||||
missing = FakeSession().add('GET', 'https://t/api/tickets_api.php', FakeResponse(404, {}),
|
||||
FakeResponse(200, {'success': False}))
|
||||
tm = TinkerClient(TINKER, 'k', session=missing)
|
||||
assert tm.ticket('1') is None
|
||||
assert tm.open_tickets() is None
|
||||
Reference in new issue
Block a user