Ejemplo n.º 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))
Ejemplo n.º 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"')
Ejemplo n.º 3
0
def test_cls_name():
    assert Shot.cls_name() == 'Shot'
Ejemplo n.º 4
0
def test_findby_name(shot):
    assert shot == Shot.find_one(project=shot.project,
                                 sequence=shot.sequence,
                                 name=shot.name)
Ejemplo n.º 5
0
def test_find_one(shot):
    assert shot == Shot.find_one(id=shot.id)
Ejemplo n.º 6
0
def test_findby_ids(shot):
    assert shot in Shot.findby_ids([shot.id])
Ejemplo n.º 7
0
def test_find(shot):
    assert shot in Shot.find()