当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
5 Star 28 Fork 739

lyonzhi / Lepus
关闭

forked from LepusGroup / lepus 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test_mysql_client_class.py 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
lyonzhi 提交于 2019-11-14 00:05 . 重新上传
#!/bin/env python
#-*-coding:utf-8-*-
import unittest
import pymysql
from include.mysql_client_class import MySQL
class TestMySQL(unittest.TestCase):
def setUp(self):
self.client = MySQL(host = '127.0.0.1',
port = 3306,
user = 'root',
passwd = 'test123',
timeout = 28800,
charset = 'utf8')
self.cursor = self.client.db_connect().cursor()
def test_init(self):
self.assertIsInstance(self.client, MySQL)
def test_flush_hosts(self):
cursor = self.cursor
self.client.flush_hosts(cursor)
def test_db_connect(self):
conn = self.client.db_connect()
self.assertIsNotNone(conn)
def test_get_mysql_variables(self):
data_dict = self.client.get_mysql_variables(self.cursor)
self.assertIsNotNone(data_dict)
def test_get_mysql_version(self):
version = self.client.get_mysql_version(self.cursor)
self.assertIsNotNone(version)
if __name__=='__main__':
unittest.main()
Python
1
https://gitee.com/zhiyoucai/Lepus.git
git@gitee.com:zhiyoucai/Lepus.git
zhiyoucai
Lepus
Lepus
master

搜索帮助