def test_clean_apt_settings(self, mock_dirs, mock_files): bu.clean_apt_settings('chroot', 'unsigned', 'force_ipv4') mock_dirs.assert_called_once_with( 'chroot', ['etc/apt/preferences.d', 'etc/apt/sources.list.d']) mock_files.assert_called_once_with( 'chroot', ['etc/apt/sources.list', 'etc/apt/preferences', 'etc/apt/apt.conf.d/%s' % 'force_ipv4', 'etc/apt/apt.conf.d/%s' % 'unsigned'])
def test_clean_apt_settings(self, mock_dirs, mock_files): bu.clean_apt_settings('chroot', 'unsigned', 'force_ipv4') mock_dirs.assert_called_once_with( 'chroot', ['etc/apt/preferences.d', 'etc/apt/sources.list.d']) files = set(['etc/apt/sources.list', 'etc/apt/preferences', 'etc/apt/apt.conf.d/%s' % 'force_ipv4', 'etc/apt/apt.conf.d/%s' % 'unsigned', 'etc/apt/apt.conf.d/01fuel_agent-use-proxy-ftp', 'etc/apt/apt.conf.d/01fuel_agent-use-proxy-http', 'etc/apt/apt.conf.d/01fuel_agent-use-proxy-https']) self.assertEqual('chroot', mock_files.call_args[0][0]) self.assertEqual(files, set(mock_files.call_args[0][1]))
def test_clean_apt_settings(self, mock_dirs, mock_files): bu.clean_apt_settings('chroot', 'unsigned', 'force_ipv4') mock_dirs.assert_called_once_with( 'chroot', ['etc/apt/preferences.d', 'etc/apt/sources.list.d']) files = set([ 'etc/apt/sources.list', 'etc/apt/preferences', 'etc/apt/apt.conf.d/%s' % 'force_ipv4', 'etc/apt/apt.conf.d/%s' % 'unsigned', 'etc/apt/apt.conf.d/01fuel_agent-use-proxy-ftp', 'etc/apt/apt.conf.d/01fuel_agent-use-proxy-http', 'etc/apt/apt.conf.d/01fuel_agent-use-proxy-https' ]) self.assertEqual('chroot', mock_files.call_args[0][0]) self.assertEqual(files, set(mock_files.call_args[0][1]))