diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-03-23 15:39:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-23 13:39:51 -0600 |
commit | a18338e99d0ab91f1f08b969bce8181938a284cc (patch) | |
tree | be6fa5446bce267654ee2c2f07bf13e03b640a82 /tests/unittests/test_handler | |
parent | df7a7857566c98df03cd7914643433b15faab5bc (diff) | |
download | vyos-cloud-init-a18338e99d0ab91f1f08b969bce8181938a284cc.tar.gz vyos-cloud-init-a18338e99d0ab91f1f08b969bce8181938a284cc.zip |
cc_apt_configure/util: combine search_for_mirror implementations (#271)
These two implementations had drifted away from one another very
slightly. Reconcile them and then remove the one in cc_apt_configure.
Diffstat (limited to 'tests/unittests/test_handler')
-rw-r--r-- | tests/unittests/test_handler/test_handler_apt_source_v3.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unittests/test_handler/test_handler_apt_source_v3.py b/tests/unittests/test_handler/test_handler_apt_source_v3.py index 90949b6d..4762dbef 100644 --- a/tests/unittests/test_handler/test_handler_apt_source_v3.py +++ b/tests/unittests/test_handler/test_handler_apt_source_v3.py @@ -670,7 +670,7 @@ class TestAptSourceConfig(t_help.FilesystemMockingTestCase): "security": [{'arches': ["default"], "search": ["sfailme", smir]}]} - with mock.patch.object(cc_apt_configure, 'search_for_mirror', + with mock.patch.object(cc_apt_configure.util, 'search_for_mirror', side_effect=[pmir, smir]) as mocksearch: mirrors = cc_apt_configure.find_apt_mirror_info(cfg, None, 'amd64') @@ -709,7 +709,7 @@ class TestAptSourceConfig(t_help.FilesystemMockingTestCase): mockgm.assert_has_calls(calls) # should not be called, since primary is specified - with mock.patch.object(cc_apt_configure, + with mock.patch.object(cc_apt_configure.util, 'search_for_mirror') as mockse: mirrors = cc_apt_configure.find_apt_mirror_info(cfg, None, arch) mockse.assert_not_called() @@ -974,7 +974,7 @@ deb http://ubuntu.com/ubuntu/ xenial-proposed main""") mocksdns.assert_has_calls(calls) # first return is for the non-dns call before - with mock.patch.object(cc_apt_configure, 'search_for_mirror', + with mock.patch.object(cc_apt_configure.util, 'search_for_mirror', side_effect=[None, pmir, None, smir]) as mockse: mirrors = cc_apt_configure.find_apt_mirror_info(cfg, mycloud, arch) |