Skip to content

Commit 64ad782

Browse files
committed
reformatting and bumping to version 0.1.2
1 parent 263213f commit 64ad782

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed

tests/test_member_app.py

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def stub_add_alias_entry():
109109
def test_save_member_edit_no_pr(self):
110110
"""Test editing an existing member without a matching PR in save_member."""
111111
from unittest.mock import MagicMock, patch
112+
112113
app = self.app
113114
app.REPO_PATH = "/tmp/testrepo"
114115
app.current_file = "existing_member.md"
@@ -119,9 +120,11 @@ def test_save_member_edit_no_pr(self):
119120
app.original_repo.create_pull = MagicMock()
120121
# Mock PR list with no matching PR
121122
app.original_repo.get_pulls = MagicMock(return_value=[])
122-
with patch("os.makedirs") as makedirs, \
123-
patch("builtins.open", MagicMock()), \
124-
patch("pygit2.Repository") as RepoMock:
123+
with (
124+
patch("os.makedirs") as makedirs,
125+
patch("builtins.open", MagicMock()),
126+
patch("pygit2.Repository") as RepoMock,
127+
):
125128
repo_instance = RepoMock.return_value
126129
repo_instance.index.add = MagicMock()
127130
repo_instance.index.write = MagicMock()
@@ -162,6 +165,7 @@ def test_save_member_edit_no_pr(self):
162165
def test_save_member_edit(self):
163166
"""Test editing an existing member with a matching PR in save_member."""
164167
from unittest.mock import MagicMock, patch
168+
165169
app = self.app
166170
app.REPO_PATH = "/tmp/testrepo"
167171
app.current_file = "existing_member.md"
@@ -175,9 +179,11 @@ def test_save_member_edit(self):
175179
mock_pr.title = "Update member profile"
176180
mock_pr.state = "open"
177181
app.original_repo.get_pulls = MagicMock(return_value=[mock_pr])
178-
with patch("os.makedirs") as makedirs, \
179-
patch("builtins.open", MagicMock()), \
180-
patch("pygit2.Repository") as RepoMock:
182+
with (
183+
patch("os.makedirs") as makedirs,
184+
patch("builtins.open", MagicMock()),
185+
patch("pygit2.Repository") as RepoMock,
186+
):
181187
repo_instance = RepoMock.return_value
182188
repo_instance.index.add = MagicMock()
183189
repo_instance.index.write = MagicMock()
@@ -222,6 +228,7 @@ def test_save_member_new(self):
222228
"""Test creating a new member scenario in save_member."""
223229
import builtins
224230
from unittest.mock import MagicMock, patch
231+
225232
app = self.app
226233
app.REPO_PATH = "/tmp/testrepo"
227234
app.current_file = None
@@ -230,9 +237,11 @@ def test_save_member_new(self):
230237
app.original_repo = MagicMock()
231238
app.original_repo.owner.login = "testowner"
232239
app.original_repo.create_pull = MagicMock()
233-
with patch("os.makedirs") as makedirs, \
234-
patch("builtins.open", MagicMock()), \
235-
patch("pygit2.Repository") as RepoMock:
240+
with (
241+
patch("os.makedirs") as makedirs,
242+
patch("builtins.open", MagicMock()),
243+
patch("pygit2.Repository") as RepoMock,
244+
):
236245
repo_instance = RepoMock.return_value
237246
repo_instance.index.add = MagicMock()
238247
repo_instance.index.write = MagicMock()
@@ -270,7 +279,8 @@ def test_save_member_new(self):
270279

271280
def test_save_member_error_handling(self):
272281
"""Test error handling in save_member when required fields are missing."""
273-
from unittest.mock import patch, MagicMock
282+
from unittest.mock import MagicMock, patch
283+
274284
app = self.app
275285
app.REPO_PATH = "/tmp/testrepo"
276286
app.current_file = None
@@ -280,10 +290,12 @@ def test_save_member_error_handling(self):
280290
app.original_repo.owner.login = "testowner"
281291
app.original_repo.create_pull = MagicMock()
282292
# Patch exit to capture error message
283-
with patch.object(app, "exit") as exit_mock, \
284-
patch("os.makedirs"), \
285-
patch("builtins.open", MagicMock()), \
286-
patch("pygit2.Repository"):
293+
with (
294+
patch.object(app, "exit") as exit_mock,
295+
patch("os.makedirs"),
296+
patch("builtins.open", MagicMock()),
297+
patch("pygit2.Repository"),
298+
):
287299
# Leave name and email blank to trigger error
288300
app.name_input.value = ""
289301
app.email_input.value = ""

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)