예제 #1
0
def test_loads_data_once(monkeypatch):
    stub_data = {'stub': {'attr': 'value'}}
    stub_value = json.dumps(json.dumps(stub_data)).encode('utf-8')
    package._nix_licenses = None

    monkeypatch.setattr(package, 'check_output', lambda *args: stub_value)
    package.get_nix_licenses()
    monkeypatch.setattr(package, 'check_output', raise_on_call)
    package.get_nix_licenses()

    assert package._nix_licenses == stub_data
예제 #2
0
def test_loads_data_once(monkeypatch):
    stub_data = {'stub': {'attr': 'value'}}
    stub_value = json.dumps(json.dumps(stub_data)).encode('utf-8')
    package._nix_licenses = None

    monkeypatch.setattr(package, 'check_output', lambda *args: stub_value)
    package.get_nix_licenses()
    monkeypatch.setattr(package, 'check_output', raise_on_call)
    package.get_nix_licenses()

    assert package._nix_licenses == stub_data
예제 #3
0
def test_get_nix_licenses():
    licenses = package.get_nix_licenses()
    assert 'gpl3' in licenses
예제 #4
0
def test_get_nix_licenses():
    licenses = package.get_nix_licenses()
    assert 'gpl3' in licenses