Exemplo n.º 1
0
def test_lca_has():
    fd = fixture_dir / "example_db"
    mapping = load_mapping(fd / "mapping.json")

    packages = [
        fd / "example_db.zip",
        fd / "ipcc.zip",
    ]

    lca = LCA(
        {mapping[("Mobility example", "Driving an electric car")]: 1},
        data_objs=packages,
    )
    assert lca.has("technosphere")
    assert lca.has("characterization")
    assert not lca.has("foo")
Exemplo n.º 2
0
def test_lca_has():
    mapping = dict(
        json.load(open(fixture_dir / "bw2io_example_db_mapping.json")))
    packages = [
        fixture_dir / "bw2io_example_db.zip",
        fixture_dir / "ipcc_simple.zip",
    ]

    lca = LCA(
        {mapping["Driving an electric car"]: 1},
        data_objs=packages,
    )
    lca.lci()
    lca.lcia()
    assert lca.has("technosphere")
    assert lca.has("characterization")
    assert not lca.has("foo")