Example #1
0
def shot_episode(sequence_episode):
    try:
        return Shot.find_one(sequence=sequence_episode, name='001')
    except NoResultFound:
        return Shot.create(project=sequence_episode.project,
                           sequence=sequence_episode,
                           name='001',
                           cut=(1001, 1002))
Example #2
0
def test_create_unique_proj_seq_name(shot):
    # Expecting IntegrityError error "Duplicate entry..."
    try:
        Shot.create(name=shot.name,
                    project=shot.sequence.project,
                    sequence=shot.sequence)
    except IntegrityError:
        return
    raise AssertionError('Expected IntegrityError due to "Duplicate entry"')
Example #3
0
def test_cls_name():
    assert Shot.cls_name() == 'Shot'
Example #4
0
def test_findby_name(shot):
    assert shot == Shot.find_one(project=shot.project,
                                 sequence=shot.sequence,
                                 name=shot.name)
Example #5
0
def test_find_one(shot):
    assert shot == Shot.find_one(id=shot.id)
Example #6
0
def test_findby_ids(shot):
    assert shot in Shot.findby_ids([shot.id])
Example #7
0
def test_find(shot):
    assert shot in Shot.find()