misc: add trailing / for chrono url in tests (#86291)

This commit is contained in:
Lauréline Guérin 2024-01-30 17:16:00 +01:00 committed by Lauréline Guérin
parent c76a8183f9
commit c5ae37c93f
2 changed files with 17 additions and 17 deletions

View File

@ -97,7 +97,7 @@ def test_collect_agenda_data():
requests_get.return_value = MockedRequestResponse(content=json.dumps(data))
assert collect_agenda_data() == []
assert requests_get.call_args_list[0][0] == ('api/agenda/',)
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org'
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org/'
data = {'data': AGENDA_DATA}
with mock.patch('requests.Session.get') as requests_get:
@ -242,7 +242,7 @@ def test_get_event():
assert str(e.value) == 'Unable to get event details'
assert requests_get.call_args_list[0][0] == ('api/agendas/events/',)
assert requests_get.call_args_list[0][1]['params']['slots'] == ['foo']
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org'
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org/'
data = {'data': ['foo']}
with mock.patch('requests.Session.get') as requests_get:
@ -304,7 +304,7 @@ def test_get_events():
assert str(e.value) == 'Unable to get events details'
assert requests_get.call_args_list[0][0] == ('api/agendas/events/',)
assert requests_get.call_args_list[0][1]['params']['slots'] == ['foo', 'bar']
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org'
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org/'
data = {'data': ['foo', 'bar']}
with mock.patch('requests.Session.get') as requests_get:
@ -358,7 +358,7 @@ def test_get_subscriptions():
requests_get.return_value = MockedRequestResponse(content=json.dumps(data))
assert get_subscriptions(agenda_slug='foo') == []
assert requests_get.call_args_list[0][0] == ('api/agenda/foo/subscription/',)
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org'
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org/'
data = {'data': ['foo', 'bar']}
with mock.patch('requests.Session.get') as requests_get:
@ -370,15 +370,15 @@ def test_get_subscriptions():
requests_get.return_value = MockedRequestResponse(content=json.dumps(data))
get_subscriptions(agenda_slug='foo', user_external_id='user:1')
assert requests_get.call_args_list[0][0] == ('api/agenda/foo/subscription/?user_external_id=user:1',)
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org'
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org/'
requests_get.reset_mock()
get_subscriptions(agenda_slug='foo', date_start=datetime.date(2022, 9, 1))
assert requests_get.call_args_list[0][0] == ('api/agenda/foo/subscription/?date_start=2022-09-01',)
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org'
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org/'
requests_get.reset_mock()
get_subscriptions(agenda_slug='foo', date_end=datetime.date(2022, 10, 1))
assert requests_get.call_args_list[0][0] == ('api/agenda/foo/subscription/?date_end=2022-10-01',)
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org'
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org/'
requests_get.reset_mock()
get_subscriptions(
agenda_slug='foo',
@ -389,7 +389,7 @@ def test_get_subscriptions():
assert requests_get.call_args_list[0][0] == (
'api/agenda/foo/subscription/?user_external_id=user:1&date_start=2022-09-01&date_end=2022-10-01',
)
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org'
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org/'
def test_get_check_status_no_service(settings):
@ -478,7 +478,7 @@ def test_get_check_status():
assert requests_get.call_args_list[0][0] == (
'api/agendas/events/check-status/?user_external_id=user:1&agendas=foo,bar&date_start=2022-09-01&date_end=2022-10-01',
)
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org'
assert requests_get.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org/'
data = {'data': ['foo', 'bar']}
with mock.patch('requests.Session.get') as requests_get:
@ -560,7 +560,7 @@ def test_lock_events_check_status():
'date_start': '2022-09-01',
'date_end': '2022-10-01',
}
assert requests_post.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org'
assert requests_post.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org/'
def test_unlock_events_check_no_service(settings):
@ -632,7 +632,7 @@ def test_unlock_events_check_status():
'date_start': '2022-09-01',
'date_end': '2022-10-01',
}
assert requests_post.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org'
assert requests_post.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org/'
def test_mark_events_invoiced_no_service(settings):
@ -704,4 +704,4 @@ def test_mark_events_invoiced_status():
'date_start': '2022-09-01',
'date_end': '2022-10-01',
}
assert requests_post.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org'
assert requests_post.call_args_list[0][1]['remote_service']['url'] == 'http://chrono.example.org/'

View File

@ -28,7 +28,7 @@ KNOWN_SERVICES = {
'chrono': {
'default': {
'title': 'test',
'url': 'http://chrono.example.org',
'url': 'http://chrono.example.org/',
'secret': 'lingo',
'orig': 'lingo',
'backoffice-menu-url': 'http://chrono.example.org/manage/',
@ -36,7 +36,7 @@ KNOWN_SERVICES = {
},
'other': {
'title': 'other',
'url': 'http://other.chrono.example.org',
'url': 'http://other.chrono.example.org/',
'secret': 'lingo',
'orig': 'lingo',
'backoffice-menu-url': 'http://other.chrono.example.org/manage/',
@ -46,9 +46,9 @@ KNOWN_SERVICES = {
'wcs': {
'default': {
'title': 'test',
'url': 'http://example.org',
'secret': 'chrono',
'orig': 'chrono',
'url': 'http://example.org/',
'secret': 'lingo',
'orig': 'lingo',
'backoffice-menu-url': 'http://example.org/manage/',
}
},