Beispiel #1
0
def default_merit():
    h = pymerit.MeritDefault()
    h.namespace = "test"
    h.path = "project=alpha/run=20134"
    h.name = "Run output"
    h.description = "Run output"
    return h
Beispiel #2
0
def test_default_serialize_no_namespace():
    """
    Serialization with invalid data
    """
    h = pymerit.MeritDefault()
    with pytest.raises(pymerit.MeritInvalidMetadata) as exc:
        h.dumps()

    assert "Missing: namespace" in str(exc)
Beispiel #3
0
def test_default_serialize_with_no_path():
    """
    Serialization with valid data 
    """
    h = pymerit.MeritDefault()
    h.namespace = "test"
    with pytest.raises(pymerit.MeritInvalidMetadata) as exc:
        h.dumps()

    assert "Missing: path" in str(exc)
Beispiel #4
0
def test_default_serialize_with_no_contexts():
    """
    Serialization with valid data 
    """
    h = pymerit.MeritDefault()
    h.namespace = "test"
    h.path = "project=alpha/run=20134"
    h.name = "Run output"
    h.description = "Run output"
    assert h.dumps() is not None
    assert isinstance(h.dump(), dict)
Beispiel #5
0
def test_default_serialize_with_no_name():
    """
    Serialization with valid data 
    """
    h = pymerit.MeritDefault()
    h.namespace = "test"
    h.path = "project=alpha/run=20134"
    with pytest.raises(pymerit.MeritInvalidMetadata) as exc:
        h.dumps()

    assert "Missing: name" in str(exc)
Beispiel #6
0
def test_default_create():
    """
    Test create default  
    """
    assert pymerit.MeritDefault()