コード例 #1
0
def track_unicode_special(DBSession, commit):
    tags_data = (
        'title:UnicodeAssention',
        'from:Hack//Sign',
        'artist:こ',
    )
    def _create_tag(tag_data):
        tag = get_tag(tag_data, create_if_missing=True)
        DBSession.add(tag)
        return tag
    tag_objs = tuple(_create_tag(tag) for tag in tags_data)
    commit()

    track = Track()
    track.id = 'x999'
    track.duration = 120
    track.tags[:] = tag_objs
    track.source_filename = 'unicode_special'

    DBSession.add(track)
    commit()

    yield track

    DBSession.delete(track)
    for tag_obj in tag_objs:
        DBSession.delete(tag_obj)
    commit()
コード例 #2
0
ファイル: tracks.py プロジェクト: calaldees/KaraKara
def track_unicode_special(DBSession, commit):
    tags_data = (
        'title:UnicodeAssention',
        'from:Hack//Sign',
        'artist:こ',
    )
    def _create_tag(tag_data):
        tag = get_tag(tag_data, create_if_missing=True)
        DBSession.add(tag)
        return tag
    tag_objs = tuple(_create_tag(tag) for tag in tags_data)
    commit()

    track = Track()
    track.id = 'x999'
    track.duration = 120
    track.tags[:] = tag_objs
    track.source_filename = 'unicode_special'

    DBSession.add(track)
    commit()

    yield track

    DBSession.delete(track)
    for tag_obj in tag_objs:
        DBSession.delete(tag_obj)
    commit()
コード例 #3
0
ファイル: queue.py プロジェクト: vanthaiunghoa/KaraKara
def queue(request, DBSession, commit):
    QUEUE_ID = 'qtest'

    queue = Queue(id=QUEUE_ID)
    DBSession.add(queue)

    queue_setting = QueueSetting()
    queue_setting.queue_id = QUEUE_ID
    queue_setting.key = 'karakara.private.password'
    queue_setting.value = QUEUE_ID
    DBSession.add(queue_setting)

    commit()
    cache.invalidate()
    yield QUEUE_ID
    DBSession.delete(queue)
コード例 #4
0
ファイル: queue.py プロジェクト: calaldees/KaraKara
def queue(request, DBSession, commit, cache_store):
    QUEUE_ID = 'qtest'

    queue = Queue(id=QUEUE_ID)
    DBSession.add(queue)

    queue_setting = QueueSetting()
    queue_setting.queue_id = QUEUE_ID
    queue_setting.key = 'karakara.private.password'
    queue_setting.value = QUEUE_ID
    DBSession.add(queue_setting)

    commit()
    cache_store.invalidate()
    yield QUEUE_ID
    DBSession.delete(queue)
コード例 #5
0
 def finalizer():
     for track in mock_tracks:
         DBSession.delete(track)
     commit()
コード例 #6
0
ファイル: tracks.py プロジェクト: richlanc/KaraKara
 def finalizer():
     for track in mock_tracks:
         DBSession.delete(track)
     commit()
コード例 #7
0
ファイル: tracks.py プロジェクト: uh2k/KaraKara
 def finalizer():
     for attachment in attachments:
         DBSession.delete(attachment)
     commit()