-
-
Save alastair/51a27925b374f248134c1135a9286718 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psycopg2 | |
conn = psycopg2.connect( | |
host="localhost", | |
database="musicbrainz_db", | |
user="musicbrainz", | |
password="musicbrainz", | |
port=5432) | |
cursor = conn.cursor() | |
def check_in_recording(rec_mbid): | |
cursor.execute("SELECT gid FROM recording WHERE gid=%(id)s;", {'id':rec_mbid}) | |
fetch = cursor.fetchone() | |
if type(fetch) == tuple: | |
return fetch[0] | |
else: | |
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import db | |
def test_check_in_recording(): | |
recording = db.check_in_recording("4a039757-f00f-4a49-a2c2-1a92d92ea9e7") | |
assert recording is None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment