def test_count(): # start database = MySQLServer('../config/mysql_account.json') database.start() database.use_db('douban_movies') # select num = database.count(table_name='my_proxy') print(num) # stop database.stop()
def test_select(): # start database = MySQLServer('../config/mysql_account.json') database.start() database.use_db('douban_movies') # select database.select(table_name='my_proxy') print(database.fetchone()) database.select(table_name='my_proxy', where={}, limit=2) print(database.fetchall()) # stop database.stop()
def test_update(): database = MySQLServer() database.set_mysql('../config/mysql_account.json') database.start() database.use_db('create_db') database.update('MovieList', { 'id': '3' }, { 'id': '123' }) database.stop()
def test_create_table(): database = MySQLServer() database.set_mysql('../config/mysql_account.json') database.start() database.use_db('create_db') database.create_table('../config/table_MovieList.json') database.stop()
def test_create_db(): database = MySQLServer() database.set_mysql('../config/mysql_account.json') database.start() database.create_db('create_db') database.stop()
def test_start_stop(): database = MySQLServer() database.set_mysql('../config/mysql_account.json') database.start() database.stop()