Пример #1
0
    def test_find_all_apt_list_files_from_apt_config_key(self, m_subp, tmpdir):
        """Find all matching apt list files from apt-config dir."""
        m_subp.return_value = ("key='{}'".format(tmpdir.strpath), "")
        repo_url = "http://c.com/fips-updates/"
        _protocol, repo_path = repo_url.split("://")
        prefix = repo_path.rstrip("/").replace("/", "_")
        paths = sorted([
            tmpdir.join(prefix + "_dists_nomatch").strpath,
            tmpdir.join(prefix + "_dists_xenial_InRelease").strpath,
            tmpdir.join(prefix +
                        "_dists_xenial_main_binary-amd64_Packages").strpath,
        ])
        for path in paths:
            util.write_file(path, "")

        assert paths[1:] == find_apt_list_files(repo_url, "xenial")
Пример #2
0
    def test_find_all_apt_list_files_from_apt_config_key(self, m_subp, tmpdir):
        """Find all matching apt list files from apt-config dir."""
        m_subp.return_value = ("key='%s'" % tmpdir.strpath, '')
        repo_url = 'http://c.com/fips-updates/'
        _protocol, repo_path = repo_url.split('://')
        prefix = repo_path.rstrip('/').replace('/', '_')
        paths = sorted([
            tmpdir.join(prefix + '_dists_nomatch').strpath,
            tmpdir.join(prefix + '_dists_xenial_InRelease').strpath,
            tmpdir.join(prefix +
                        '_dists_xenial_main_binary-amd64_Packages').strpath
        ])
        for path in paths:
            util.write_file(path, '')

        assert paths[1:] == find_apt_list_files(repo_url, 'xenial')