-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_case.py
More file actions
25 lines (20 loc) · 729 Bytes
/
test_case.py
File metadata and controls
25 lines (20 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from src.databases import PostgreDAO, MysqlDAO, CommonDAO
from src.users import User
# Create user instance
user = User(name='Persie', surname='Jackson', email='pers.jafdcffks@mail.com')
# Create DAO's instances
postgre_dao = PostgreDAO()
mysql_dao = MysqlDAO()
common_dao = CommonDAO()
# Create, update, delete user in MySQL
mysql_dao.create(user)
mysql_dao.update(user, name='Rico', surname='Miura')
mysql_dao.delete(user)
# Create, update, delete user in PostgreSQL
postgre_dao.create(user)
postgre_dao.update(user, name='Rico', surname='Miura')
postgre_dao.delete(user)
# Create, update, delete user in both databases
common_dao.create(user)
common_dao.update(user, name='Rico', surname='Miura')
common_dao.delete(user)