Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/release_delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def command(*args, data=None, optional=False, env=None):


def api(repo, path, optional=False):
raw = command('gh', 'api', f'repos/{repo}/{path}', optional=optional)
raw = command('gh', 'api', f'repos/{repo}/{path}'.rstrip('/'), optional=optional)
return json.loads(raw) if raw is not None else None


Expand Down
7 changes: 7 additions & 0 deletions tests/test_release_delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
spec.loader.exec_module(delivery)


class APITransportTests(unittest.TestCase):
def test_repository_metadata_uses_canonical_api_root(self):
with patch.object(delivery, 'command', return_value=b'{}') as command:
self.assertEqual(delivery.api(delivery.APP, ''), {})
command.assert_called_once_with('gh', 'api', 'repos/' + delivery.APP, optional=False)


class DeliveryTests(unittest.TestCase):
def setUp(self):
self.sha = 'a' * 40
Expand Down
Loading