Skip to content

Commit 99a8ac8

Browse files
committed
Remove MagicMock from test_build Build params
1 parent bbfb96b commit 99a8ac8

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

binderhub/tests/test_build.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ def test_default_affinity():
122122
api=mock_k8s_api,
123123
name="test_build",
124124
namespace="build_namespace",
125-
repo_url=mock.MagicMock(spec=str),
126-
ref=mock.MagicMock(spec=str),
127-
build_image=mock.MagicMock(spec=str),
128-
image_name=mock.MagicMock(spec=str),
129-
push_secret=mock.MagicMock(spec=str),
130-
memory_limit=mock.MagicMock(spec=int),
125+
repo_url="repo",
126+
ref="ref",
127+
build_image="image",
128+
image_name="name",
129+
push_secret="",
130+
memory_limit=0,
131131
git_credentials=None,
132132
docker_host="http://mydockerregistry.local",
133-
node_selector=mock.MagicMock(spec=dict),
133+
node_selector={},
134134
)
135135

136136
affinity = build.get_affinity()
@@ -150,15 +150,15 @@ def test_sticky_builds_affinity():
150150
api=mock_k8s_api,
151151
name="test_build",
152152
namespace="build_namespace",
153-
repo_url=mock.MagicMock(spec=str),
154-
ref=mock.MagicMock(spec=str),
155-
build_image=mock.MagicMock(spec=str),
156-
image_name=mock.MagicMock(spec=str),
157-
push_secret=mock.MagicMock(spec=str),
158-
memory_limit=mock.MagicMock(spec=int),
153+
repo_url="repo",
154+
ref="ref",
155+
build_image="image",
156+
image_name="name",
157+
push_secret="",
158+
memory_limit=0,
159159
git_credentials=None,
160160
docker_host="http://mydockerregistry.local",
161-
node_selector=mock.MagicMock(spec=dict),
161+
node_selector={},
162162
sticky_builds=True,
163163
)
164164

@@ -188,15 +188,15 @@ def test_git_credentials_passed_to_podspec_upon_submit():
188188
api=mock_k8s_api,
189189
name="test_build",
190190
namespace="build_namespace",
191-
repo_url=mock.MagicMock(spec=str),
192-
ref=mock.MagicMock(spec=str),
191+
repo_url="repo",
192+
ref="ref",
193+
build_image="image",
194+
image_name="name",
195+
push_secret="",
196+
memory_limit=0,
193197
git_credentials=git_credentials,
194-
build_image=mock.MagicMock(spec=str),
195-
image_name=mock.MagicMock(spec=str),
196-
push_secret=mock.MagicMock(spec=str),
197-
memory_limit=mock.MagicMock(spec=int),
198198
docker_host="http://mydockerregistry.local",
199-
node_selector=mock.MagicMock(spec=dict),
199+
node_selector={},
200200
)
201201

202202
with mock.patch.object(build.stop_event, "is_set", return_value=True):

0 commit comments

Comments
 (0)