Skip to content

Commit 1d71258

Browse files
committed
Add unit test showing we avoid useless requests
If the user calls add_email_addresses with an empty list we should not issue an API request. Based on feedback from @itsmemattchung
1 parent 8f9e271 commit 1d71258

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎tests/unit/test_github.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ def test_add_email_addresses(self):
2525
2626
)
2727

28+
def test_add_email_addresses_with_empty_list(self):
29+
"""Verify no request is sent for an empty list of addresses."""
30+
self.instance.add_email_addresses([])
31+
32+
assert self.session.post.called is False
33+
2834
def test_authorization(self):
2935
"""Show that a user can retrieve a specific authorization by id."""
3036
self.instance.authorization(10)

0 commit comments

Comments
 (0)