def tearDownClass(cls): cls.pg = Postgres(DB_SERVER, DB_PORT, DB_DATABASE, DB_USER, DB_PASSWORD) cls.pg.pg_cur.execute('delete from kino.movies2companies') cls.pg.pg_cur.execute('delete from kino.companies') cls.pg.pg_cur.execute('delete from kino.company_roles') cls.pg.pg_cur.execute('delete from kino.movies') cls.pg.pg_conn.commit()
def setUpClass(cls): cls.main = Main() cls.pg = Postgres(DB_SERVER, DB_PORT, DB_DATABASE, DB_USER, DB_PASSWORD) # We insert the corresponding film into kino.movies # due to the foreign key constraint. sql = """insert into kino.movies (imdb_id, title, runtime, rated, released, orig_language, plot) values ('tt2562232', 'Birdman or (The Unexpected Virtue of Ignorance)', 119, 'R', '2014-08-27', 'en', 'Some plot')""" cls.pg.pg_cur.execute(sql) cls.pg.pg_conn.commit()
def tearDownClass(cls): cls.pg = Postgres(DB_SERVER, DB_PORT, DB_DATABASE, DB_USER, DB_PASSWORD) cls.pg.pg_cur.execute('delete from kino.languages') cls.pg.pg_cur.execute('delete from kino.movies') cls.pg.pg_cur.execute('delete from kino.movies2companies') cls.pg.pg_cur.execute('delete from kino.companies') cls.pg.pg_cur.execute('delete from kino.genres') cls.pg.pg_cur.execute('delete from kino.movies2genres') cls.pg.pg_cur.execute('delete from kino.movies2numbers') cls.pg.pg_cur.execute('delete from kino.movies2persons') cls.pg.pg_cur.execute('delete from kino.persons') cls.pg.pg_cur.execute('delete from kino.movies2ratings') cls.pg.pg_cur.execute('delete from kino.movies2streams') cls.pg.pg_cur.execute('delete from kino.movies2trailers') cls.pg.pg_cur.execute('delete from kino.errored') cls.pg.pg_conn.commit()
def __init__(self): self.pg = Postgres(DB_SERVER, DB_PORT, DB_DATABASE, DB_USER, DB_PASSWORD) self.source_topic = 'movies' self.destination_topic = 'movies2genres'
def setUpClass(cls): cls.main = Main() cls.pg = Postgres(DB_SERVER, DB_PORT, DB_DATABASE, DB_USER, DB_PASSWORD)
def __init__(self): self.pg = Postgres(DB_SERVER, DB_PORT, DB_DATABASE, DB_USER, DB_PASSWORD) self.source_topic = 'errored' self.destination_topic = 'DONE'