Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (17 sloc) 0.619 kb
# Copyright (C) 2011 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
from import *
from tests import prepare_database, with_database
from import find_or_insert_format
def test_find_or_insert_format(conn):
id = find_or_insert_format(conn, 'FLAC')
assert_equals(1, id)
id = find_or_insert_format(conn, 'MP3')
assert_equals(2, id)
rows = conn.execute("SELECT id, name FROM format ORDER BY id").fetchall()
expected_rows = [
(1, 'FLAC'),
(2, 'MP3'),
assert_equals(expected_rows, rows)
Jump to Line
Something went wrong with that request. Please try again.