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