コード例 #1
0
def test_insert(datasource):  # noqa: F811
    """Can we insert new elements"""
    primary_key = datasource.store_taskmanager("taskmanager3", "33333333-3333-3333-3333-333333333333")
    assert primary_key > 1

    header = Header(primary_key)
    metadata = Metadata(primary_key)
    datasource.insert(
        primary_key,
        1,
        "sample_test_key",
        b"sample_test_value",
        header,
        metadata,
    )

    result1 = datasource.get_dataproducts(taskmanager_id=primary_key)

    assert result1 == [
        {
            "key": "sample_test_key",
            "taskmanager_id": primary_key,
            "generation_id": 1,
            "value": b"sample_test_value",
        }
    ]

    result2 = datasource.get_dataproducts(taskmanager_id=primary_key, key="sample_test_key")

    assert result1 == result2
コード例 #2
0
def test_store_taskmanager(datasource):  # noqa: F811
    """Can we make new entries"""
    primary_key = datasource.store_taskmanager(
        name="taskmanager3",
        taskmanager_id="00000003-0003-0003-0003-000000000003",
    )
    assert primary_key > 1