Exemple #1
0
def test_add_additional_artifact():
    artifact = Artifact('abc.txt')
    artifact.artifacts_dir = 'artifacts'
    new_artifact = artifact.add_additional_artifact('def.txt', '.txt')
    assert new_artifact.final
    assert new_artifact.additional
    assert new_artifact.key in artifact.inputs()
Exemple #2
0
def test_add_additional_artifact():
    artifact = Artifact()
    artifact.key = 'abc.txt'
    artifact.artifacts_dir = 'artifactsx'
    artifact.hashstring = "abcdef123"

    new_artifact = artifact.add_additional_artifact('def.txt', '.txt')

    assert is_empty_dict(new_artifact._inputs)
    assert new_artifact.args.keys() == ["globals"]
    assert is_empty_dict(new_artifact.args['globals'])
    assert new_artifact.additional
    assert new_artifact.artifact_class_source
    assert new_artifact.artifacts_dir == 'artifactsx'
    assert new_artifact.final
    assert new_artifact.key in artifact.inputs()
    assert new_artifact.state == 'new'
Exemple #3
0
def test_add_additional_artifact():
    db = dexy.utils.get_db(logsdir=None, dbfile=None)
    hashstring = "abcdef123"
    artifact = Artifact()
    artifact.db = db
    artifact.key = 'abc.txt'
    artifact.artifacts_dir = 'artifactsx'
    artifact.hashstring = hashstring

    new_artifact = artifact.add_additional_artifact('def.txt', '.txt')

    assert is_empty_dict(new_artifact._inputs)
    assert new_artifact.args.keys() == ["globals"]
    assert is_empty_dict(new_artifact.args['globals'])
    assert new_artifact.additional
    assert new_artifact.artifact_class_source
    assert new_artifact.artifacts_dir == 'artifactsx'
    assert new_artifact.final
    assert new_artifact.key in artifact.inputs()
    assert new_artifact.state == 'new'
    assert new_artifact.inode == hashstring

    assert db.artifact_row(new_artifact)['key'] == new_artifact.key