lrossett / centos / centpkg

Forked from centos/centpkg 4 years ago
Clone
Blob Blame History Raw
import configparser
from centpkg.api import lookaside


def test_lookaside_download_url(fixtures_dir):
    config = configparser.ConfigParser()
    config.read(f'{fixtures_dir}/centpkg.conf')
    section = config.sections()[0]
    _lookaside = lookaside.CentOSLookasideCache(config[section]['lookasidehash'],
                                       config[section]['lookaside'],
                                       config[section]['lookaside_cgi'])

    expected = f'{ config[section]["lookaside"]}/name/dev/hash'
    actual = _lookaside.get_download_url('name', 'fname', 'hash', branch='dev')
    assert expected == actual