summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-05-25 09:32:39 +0200
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-05-25 09:32:39 +0200
commita84747a8b7a6b527e8ee294e6fc04d70a7090bc5 (patch)
tree2501e4fd20fd6dbc2fac2f173b618e2614f60ed9 /tests
parent150abceed3ec8d1d5099e855ebc4fce0361be65d (diff)
downloadvyos-cloud-init-a84747a8b7a6b527e8ee294e6fc04d70a7090bc5.tar.gz
vyos-cloud-init-a84747a8b7a6b527e8ee294e6fc04d70a7090bc5.zip
make test_apt_srcl_custom independent to where it is executed
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/test_handler/test_handler_apt_configure_sources_list.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/unittests/test_handler/test_handler_apt_configure_sources_list.py b/tests/unittests/test_handler/test_handler_apt_configure_sources_list.py
index 353422a2..5cf386f8 100644
--- a/tests/unittests/test_handler/test_handler_apt_configure_sources_list.py
+++ b/tests/unittests/test_handler/test_handler_apt_configure_sources_list.py
@@ -55,8 +55,8 @@ EXPECTED_CONVERTED_CONTENT = (
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
-deb http://archive.ubuntu.com/ubuntu/ xenial main restricted
-deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted
+deb http://archive.ubuntu.com/ubuntu/ fakerelease main restricted
+deb-src http://archive.ubuntu.com/ubuntu/ fakerelease main restricted
# FIND_SOMETHING_SPECIAL
""")
@@ -152,8 +152,10 @@ class TestAptSourceConfigSourceList(t_help.FilesystemMockingTestCase):
# the second mock restores the original subp
with mock.patch.object(util, 'write_file') as mockwrite:
with mock.patch.object(util, 'subp', self.subp):
- cc_apt_configure.handle("notimportant", cfg, mycloud,
- LOG, None)
+ with mock.patch.object(cc_apt_configure, 'get_release',
+ return_value='fakerelease'):
+ cc_apt_configure.handle("notimportant", cfg, mycloud,
+ LOG, None)
mockwrite.assert_called_once_with(
'/etc/apt/sources.list',