示例#1
0
 def test_get_artist_credit(self):
     with db.engine.connect() as connection:
         recording_msid = data.submit_recording(connection, recording)
         artist_msid = data.get_artist_credit(connection,
                                              recording['artist'])
         recording_data = data.load_recording(connection, recording_msid)
         self.assertEqual(artist_msid, recording_data['ids']['artist_msid'])
示例#2
0
 def test_get_release(self):
     with db.engine.connect() as connection:
         recording_msid = data.submit_recording(connection, recording)
         release_msid = data.get_release(connection, recording['release'])
         recording_data = data.load_recording(connection, recording_msid)
         self.assertEqual(release_msid,
                          recording_data['ids']['release_msid'])
def insert_single(connection, recording):
    gid = data.get_id_from_recording(connection, recording)
    if not gid:
        gid = data.submit_recording(connection, recording)
    loaded = data.load_recording(connection, gid)
    return loaded
示例#4
0
 def test_submit_recording(self):
     with db.engine.connect() as connection:
         recording_msid = data.submit_recording(connection, recording)
         self.assertEqual(
             recording_msid,
             str(data.get_id_from_recording(connection, recording)))