def test_configure_install_source_distro_proposed(
self, _spcc, _open, _lsb):
"""Test configuring installation source from deb repo url"""
_lsb.return_value = FAKE_RELEASE
_file = MagicMock(spec=io.FileIO)
_open.return_value = _file
openstack.configure_installation_source('distro-proposed')
_file.__enter__().write.assert_called_once_with(
'# Proposed\ndeb http://archive.ubuntu.com/ubuntu '
'precise-proposed main universe multiverse restricted\n')
src = ('deb http://archive.ubuntu.com/ubuntu/ precise-proposed '
'restricted main multiverse universe')
openstack.configure_installation_source(src)
_spcc.assert_called_once_with(
['add-apt-repository', '--yes',
'deb http://archive.ubuntu.com/ubuntu/ precise-proposed '
'restricted main multiverse universe'])
评论列表
文章目录