Exemple #1
0
def test_process_activities(no_init, monkeypatch):
    monkeypatch.setattr("bw2io.importers.excel.ExcelImporter.get_activity",
                        lambda a, b, c: c)
    ei = ExcelImporter()
    with pytest.raises(ValueError):
        assert ei.process_activities([("name", [["cutoff", "foo"]])])

    given = [("n", [["cutoff", "2"], ["", ""], ["activity", "foo", "bar"],
                    ["1", "2", "3"]])]
    expected = [[["activity", "foo"], ["1", "2"]]]
    assert ei.process_activities(given) == expected
Exemple #2
0
def test_process_activities(no_init, monkeypatch):
    monkeypatch.setattr('bw2io.importers.excel.ExcelImporter.get_activity',
                        lambda a, b, c: c)
    ei = ExcelImporter()
    with pytest.raises(ValueError):
        assert ei.process_activities([('name', [['cutoff', 'foo']])])

    given = [('n', [['cutoff', '2'], ['', ''], ['activity', 'foo', 'bar'],
                    ['1', '2', '3']])]
    expected = [[['activity', 'foo'], ['1', '2']]]
    assert ei.process_activities(given) == expected