Beispiel #1
0
def test_project_datetime_loading(project_meta):
    """Check that datetime is correctly loaded."""
    project = Project.from_jsonld(
        yaml.load(project_meta, Loader=NoDatesSafeLoader))

    assert isinstance(project.updated, datetime)
    assert isinstance(project.created, datetime)

    assert project.updated.tzinfo is not None
    assert project.created.tzinfo is not None
Beispiel #2
0
def test_project_metadata_compatibility(project_meta, version, is_broken):
    """Test loading of the initial version."""
    project = Project.from_jsonld(
        yaml.load(project_meta, Loader=NoDatesSafeLoader))

    assert str(version) == project.version

    if not is_broken:
        assert 'demo' == project.name

    assert 'schema:name' == project._jsonld_context['name']
    main_context_creator = project._jsonld_context['creator']
    assert Person._jsonld_context == main_context_creator['@context']
    assert 'schema:dateUpdated' == project._jsonld_context['updated']
    assert 'schema:dateCreated' == project._jsonld_context['created']
    assert 'schema:schemaVersion' == project._jsonld_context['version']