Ejemplo n.º 1
0
def test_list_of_functions_also_possible(fake_report):
    list_of_functions = [
        lambda x: x + [1],
        lambda x: x + [2]
    ]
    report, data = system_model([], list_of_functions)
    assert data == [1,2]
Ejemplo n.º 2
0
def test_collection_applied_in_order(fake_report):
    collection = Collection(
        "foo",
        lambda x: x + [1],
        lambda x: x + [2]
    )
    report, data = system_model([], collection)
    assert data == [1,2]
Ejemplo n.º 3
0
def test_can_nest_collections(fake_report):
    empty_collection = Collection()
    report, data = system_model([1, 2, 3, 4], Collection(empty_collection))
    assert data == [1, 2, 3, 4]
Ejemplo n.º 4
0
def test_can_pass_collection_directly(fake_report):
    """i.e. not in a list"""
    collection = Collection(lambda x: x)
    report, data = system_model([1, 2, 3, 4], collection)
    assert data == [1, 2, 3, 4]
Ejemplo n.º 5
0
def test_empty_collection(fake_report):
    empty_collection = Collection()
    report, data = system_model([1, 2, 3, 4], [empty_collection])
    assert data == [1, 2, 3, 4]
Ejemplo n.º 6
0
def test_report_and_extract_directory_mock(fake_report):
    output_dir, data = system_model([])
    assert data == []
    # Directory not in usual place
    assert "Ocelot" not in output_dir.directory
Ejemplo n.º 7
0
def test_can_nest_collections(fake_report):
    empty_collection = Collection("0")
    report, data = system_model([1,2,3,4], [Collection("0", empty_collection)])
    assert data == [1,2,3,4]
Ejemplo n.º 8
0
def test_can_pass_collection_directly(fake_report):
    """i.e. not in a list"""
    collection = Collection("l", lambda x: x)
    report, data = system_model([1,2,3,4], collection)
    assert data == [1,2,3,4]
Ejemplo n.º 9
0
def test_empty_collection(fake_report):
    empty_collection = Collection("0")
    report, data = system_model([1,2,3,4], [empty_collection])
    assert data == [1,2,3,4]
Ejemplo n.º 10
0
def test_report_and_extract_directory_mock(fake_report):
    output_dir, data = system_model([])
    assert data == []
    # Directory not in usual place
    assert "Ocelot" not in output_dir.directory