def test_configure_install_source_uca_repos(
self, _fip, _lsb, _install, _open):
"""Test configuring installation source from UCA sources"""
_lsb.return_value = FAKE_RELEASE
_file = MagicMock(spec=io.FileIO)
_open.return_value = _file
_fip.side_effect = lambda x: x
for src, url in UCA_SOURCES:
actual_url = "# Ubuntu Cloud Archive\n{}\n".format(url)
fetch.add_source(src)
_install.assert_called_with(['ubuntu-cloud-keyring'],
fatal=True)
_open.assert_called_with(
'/etc/apt/sources.list.d/cloud-archive.list',
'w'
)
_file.__enter__().write.assert_called_with(actual_url)
评论列表
文章目录