Пример #1
0
def test_add_unicity(create_buildhub_data, get_result):
    data = buildhub.get_raw()
    data, buildids, buildids_per_prod = buildhub.extract(data)
    buildhub.add_unicity_info(data, buildids, buildids_per_prod)
    x = get_result('tests/data/buildhub/unicity.json', data)

    assert x == data
Пример #2
0
def test_get_last_versions(create_buildhub_data, get_result):
    data = buildhub.get_raw()
    data, _, _ = buildhub.extract(data)
    buildhub.get_last_versions(data)
    x = get_result('tests/data/buildhub/last_versions.json', data)

    assert x == data
Пример #3
0
def create_buildhub_data():
    if not os.path.isfile(MyResponse.path):
        data = buildhub.get_raw()
        with open(MyResponse.path, 'w') as Out:
            json.dump(data,
                      Out,
                      sort_keys=True,
                      indent=4,
                      separators=(',', ': '))
    yield None
Пример #4
0
def test_extract(create_buildhub_data, get_result):
    data = buildhub.get_raw()
    data, buildids, buildids_per_prod = buildhub.extract(data)
    data = {
        'data': data,
        'buildids': buildids,
        'buildids_per_prod': buildids_per_prod
    }
    x = get_result('tests/data/buildhub/extract.json', data)

    assert x['data'] == data['data']
    assert x['buildids'] == data['buildids']
    assert x['buildids_per_prod'] == data['buildids_per_prod']
Пример #5
0
def test_make_request(create_buildhub_data):
    d = buildhub.get_raw()
    assert d == MyResponse(False).json()
Пример #6
0
def create_buildhub_data():
    if not os.path.isfile(MyResponse.path):
        data = buildhub.get_raw()
        dumpjson(MyResponse.path, data)

    yield None