Пример #1
0
def test_name_adapter_add():
    adapter = packages_model.NameAdapter()
    adapter.add(column_header="Title Page", data_entry="title_page")
    assert len(adapter) == 1
Пример #2
0
def test_name_adapter_get_data_entry_from_column():
    adapter = packages_model.NameAdapter()
    adapter.add(column_header="Title Page", data_entry="title_page")
    assert adapter.get_data_entry(column_header="Title Page") == "title_page"
Пример #3
0
def test_name_adapter_empty_len():
    adapter = packages_model.NameAdapter()
    assert len(adapter) == 0
Пример #4
0
def test_multiple_mappings_error():
    adapter = packages_model.NameAdapter()
    adapter.add(column_header="Title Page", data_entry="title_page")
    with pytest.raises(AttributeError):
        adapter.add(column_header="Title Page", data_entry="something_else")