Skip to content

test_publish#

catalog_record_creator#

Ensure dataset has the right creator

Parameters:

Name Type Description Default
published_dataset
required
qvain_publish_request
required

Returns:

Source code in tests/behave/features/qvain/test_publish.py
@pytest.fixture
@when("the user is saved as creator to the dataset")
def catalog_record_creator(published_dataset, qvain_publish_request, qvain_user):
    """Ensure dataset has the right creator

    Args:
        published_dataset ():
        qvain_publish_request ():

    Returns:

    """
    published_dataset.system_creator = qvain_user
    yield published_dataset
    raise NotImplementedError

dataset_is_published#

Parameters:

Name Type Description Default
published_dataset Dataset

Research Dataset to be published

required
Source code in tests/behave/features/qvain/test_publish.py
@then("dataset is published")
def dataset_is_published(published_dataset, ida_data_catalog):
    """

    Args:
        published_dataset (Dataset): Research Dataset to be published

    """
    assert published_dataset.data_catalog == ida_data_catalog
    assert published_dataset.issued is not None

published_dataset#

Parameters:

Name Type Description Default
published_dataset Dataset

Research Dataset to be published

required
Source code in tests/behave/features/qvain/test_publish.py
@then("published dataset exists with persistent identifier")
def published_dataset(published_dataset, qvain_publish_request):
    """

    Args:
        published_dataset (Dataset): Research Dataset to be published

    """
    assert published_dataset.persistent_identifier is not None

dataset_has_creator#

Parameters:

Name Type Description Default
catalog_record_creator
required
qvain_publish_request

publish API-request

required
published_dataset Dataset
required

Returns:

Source code in tests/behave/features/qvain/test_publish.py
@then("the dataset has a creator")
def dataset_has_creator(catalog_record_creator, qvain_publish_request, published_dataset):
    """

    Args:
        catalog_record_creator ():
        qvain_publish_request (): publish API-request
        published_dataset (Dataset):

    Returns:

    """
    assert qvain_publish_request.user is published_dataset.system_creator

test_dataset_publish#

Source code in tests/behave/features/qvain/test_publish.py
@pytest.mark.xfail(raises=NotImplementedError)
@scenario("dataset.feature", "Publishing new dataset")
def test_dataset_publish(published_dataset, ida_data_catalog):
    assert published_dataset.data_catalog == ida_data_catalog
    assert published_dataset.issued is not None