Exemplo n.º 1
0
def test_shot_add_instance_fail(shot, instance_shot):
    # Expect to fail with InstanceNameExists error.
    try:
        Instance.add_instance(shot, instance_shot.asset, instance_shot.name)
    except InstanceNameExists:
        return
    raise AssertionError('Expected a InstanceNameExists due to instance name exists')
Exemplo n.º 2
0
def instance_shot(shot, asset):
    try:
        return Instance.find_one(project=shot.project, entity=shot,
                                 asset=asset, name='instance01')
    except NoResultFound:
        return Instance.create(project=shot.project, entity=shot,
                               asset=asset, name='instance01')
Exemplo n.º 3
0
def test_create_bad_arguments_asset(instance_shot):
    # Expecting TypeError error, wrong argument/entity given.
    try:
        Instance.create(project=instance_shot.project, name=instance_shot.name,
                        asset=instance_shot.asset, entity=instance_shot.asset)
    except TypeError:
        return
    raise AssertionError('Expected TypeError due to wrong arg type')
Exemplo n.º 4
0
def test_create_unique_seq_name(instance_sequence):
    # Expecting IntegrityError error "Duplicate entry..."
    try:
        Instance.create(project=instance_sequence.project, name=instance_sequence.name,
                        asset=instance_sequence.asset, entity=instance_sequence.parent)
    except IntegrityError:
        return
    raise AssertionError('Expected IntegrityError due to "Duplicate entry"')
Exemplo n.º 5
0
def test_findby_name(instance_shot):
    assert instance_shot == Instance.find_one(project=instance_shot.project,
                                              entity=instance_shot.shot,
                                              name=instance_shot.name)
Exemplo n.º 6
0
def test_find_one(instance_shot):
    assert instance_shot == Instance.find_one(id=instance_shot.id)
Exemplo n.º 7
0
def test_findby_ids(instance_shot):
    assert instance_shot in Instance.findby_ids([instance_shot.id])
Exemplo n.º 8
0
def test_find(instance_shot):
    assert instance_shot in Instance.find()
Exemplo n.º 9
0
def test_cls_name():
    assert Instance.cls_name() == 'Instance'
Exemplo n.º 10
0
def test_sequence_add_instance(sequence, asset):
    Instance.add_instance(sequence, asset, asset.name + 'new_1')
Exemplo n.º 11
0
def test_shot_add_instance(shot, asset):
    Instance.add_instance(shot, asset, asset.name + 'new_1')