Remove MagicMock from test_build Build params
@@ -122,15 +122,15 @@ def test_default_affinity():
api=mock_k8s_api,
name="test_build",
namespace="build_namespace",
- repo_url=mock.MagicMock(spec=str),
- ref=mock.MagicMock(spec=str),
- build_image=mock.MagicMock(spec=str),
- image_name=mock.MagicMock(spec=str),
- push_secret=mock.MagicMock(spec=str),
- memory_limit=mock.MagicMock(spec=int),
+ repo_url="repo",
+ ref="ref",
+ build_image="image",
+ image_name="name",
+ push_secret="",
+ memory_limit=0,
git_credentials=None,
docker_host="http://mydockerregistry.local",
- node_selector=mock.MagicMock(spec=dict),
+ node_selector={},
)
affinity = build.get_affinity()
@@ -150,15 +150,15 @@ def test_sticky_builds_affinity():
api=mock_k8s_api,
name="test_build",
namespace="build_namespace",
- repo_url=mock.MagicMock(spec=str),
- ref=mock.MagicMock(spec=str),
- build_image=mock.MagicMock(spec=str),
- image_name=mock.MagicMock(spec=str),
- push_secret=mock.MagicMock(spec=str),
- memory_limit=mock.MagicMock(spec=int),
+ repo_url="repo",
+ ref="ref",
+ build_image="image",
+ image_name="name",
+ push_secret="",
+ memory_limit=0,
git_credentials=None,
docker_host="http://mydockerregistry.local",
- node_selector=mock.MagicMock(spec=dict),
+ node_selector={},
sticky_builds=True,
)
@@ -188,15 +188,15 @@ def test_git_credentials_passed_to_podspec_upon_submit():
api=mock_k8s_api,
name="test_build",
namespace="build_namespace",
- repo_url=mock.MagicMock(spec=str),
- ref=mock.MagicMock(spec=str),
+ repo_url="repo",
+ ref="ref",
+ build_image="image",
+ image_name="name",
+ push_secret="",
+ memory_limit=0,
git_credentials=git_credentials,
- build_image=mock.MagicMock(spec=str),
- image_name=mock.MagicMock(spec=str),
- push_secret=mock.MagicMock(spec=str),
- memory_limit=mock.MagicMock(spec=int),
docker_host="http://mydockerregistry.local",
- node_selector=mock.MagicMock(spec=dict),
+ node_selector={},
)
with mock.patch.object(build.stop_event, "is_set", return_value=True):
