Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 6
0
def test_default_create():
    """
    Test create default  
    """
    assert pymerit.MeritDefault()