Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
my_flask_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7031d4d1
authored
Dec 08, 2023
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化测试用例
1 parent
f9b75483
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletions
databases01.py
test.py
databases01.py
View file @
7031d4d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
pymysql
import
pymysql
# 连接database
# 连接database
conn
=
pymysql
.
connect
(
host
=
'192.168.3.
190
'
,
port
=
3306
,
user
=
'dev_user'
,
password
=
'df234fl'
,
database
=
'neshield'
,
conn
=
pymysql
.
connect
(
host
=
'192.168.3.
227
'
,
port
=
3306
,
user
=
'dev_user'
,
password
=
'df234fl'
,
database
=
'neshield'
,
charset
=
'utf8'
)
charset
=
'utf8'
)
# 得到一个可以执行SQL语句的光标对象
# 得到一个可以执行SQL语句的光标对象
cursor
=
conn
.
cursor
()
cursor
=
conn
.
cursor
()
...
...
test.py
0 → 100644
View file @
7031d4d
import
unittest
class
MyTest
(
unittest
.
TestCase
):
def
test_addition
(
self
):
result
=
2
+
2
self
.
assertEqual
(
result
,
4
)
def
test_subtraction
(
self
):
result
=
5
-
3
self
.
assertEqual
(
result
,
2
)
def
fname
(
self
):
result
=
5
-
3
self
.
assertEqual
(
result
,
2
)
if
__name__
==
"__main__"
:
unittest
.
main
()
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment