Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita974866

Browse files
Test structures were refactored (local, local2, remote)
1 parent285e5b7 commita974866

File tree

7 files changed

+262
-192
lines changed

7 files changed

+262
-192
lines changed

‎tests/helpers/global_data.py

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
from ...testgres.operations.os_opsimportOsOperations
2+
from ...testgres.operations.os_opsimportConnectionParams
3+
from ...testgres.operations.local_opsimportLocalOperations
4+
from ...testgres.operations.remote_opsimportRemoteOperations
5+
6+
from ...testgres.nodeimportPostgresNodePortManager
7+
from ...testgres.nodeimportPostgresNodePortManager__ThisHost
8+
from ...testgres.nodeimportPostgresNodePortManager__Generic
9+
10+
importos
11+
12+
13+
classOsOpsDescr:
14+
sign:str
15+
os_ops:OsOperations
16+
17+
def__init__(self,sign:str,os_ops:OsOperations):
18+
asserttype(sign)==str# noqa: E721
19+
assertisinstance(os_ops,OsOperations)
20+
self.sign=sign
21+
self.os_ops=os_ops
22+
23+
24+
classOsOpsDescrs:
25+
sm_remote_conn_params=ConnectionParams(
26+
host=os.getenv('RDBMS_TESTPOOL1_HOST')or'127.0.0.1',
27+
username=os.getenv('USER'),
28+
ssh_key=os.getenv('RDBMS_TESTPOOL_SSHKEY'))
29+
30+
sm_remote_os_ops=RemoteOperations(sm_remote_conn_params)
31+
32+
sm_remote_os_ops_descr=OsOpsDescr("remote_ops",sm_remote_os_ops)
33+
34+
sm_local_os_ops=LocalOperations()
35+
36+
sm_local_os_ops_descr=OsOpsDescr("local_ops",sm_local_os_ops)
37+
38+
39+
classPortManagers:
40+
sm_remote_port_manager=PostgresNodePortManager__Generic(OsOpsDescrs.sm_remote_os_ops)
41+
42+
sm_local_port_manager=PostgresNodePortManager__ThisHost()
43+
44+
sm_local2_port_manager=PostgresNodePortManager__Generic(OsOpsDescrs.sm_local_os_ops)
45+
46+
47+
classPostgresNodeService:
48+
sign:str
49+
os_ops:OsOperations
50+
port_manager:PostgresNodePortManager
51+
52+
def__init__(self,sign:str,os_ops:OsOperations,port_manager:PostgresNodePortManager):
53+
asserttype(sign)==str# noqa: E721
54+
assertisinstance(os_ops,OsOperations)
55+
assertisinstance(port_manager,PostgresNodePortManager)
56+
self.sign=sign
57+
self.os_ops=os_ops
58+
self.port_manager=port_manager
59+
60+
61+
classPostgresNodeServices:
62+
sm_remote=PostgresNodeService(
63+
"remote",
64+
OsOpsDescrs.sm_remote_os_ops,
65+
PortManagers.sm_remote_port_manager
66+
)
67+
68+
sm_local=PostgresNodeService(
69+
"local",
70+
OsOpsDescrs.sm_local_os_ops,
71+
PortManagers.sm_local_port_manager
72+
)
73+
74+
sm_local2=PostgresNodeService(
75+
"local2",
76+
OsOpsDescrs.sm_local_os_ops,
77+
PortManagers.sm_local2_port_manager
78+
)

‎tests/helpers/os_ops_descrs.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

‎tests/test_os_ops_common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
2-
from .helpers.os_ops_descrsimportOsOpsDescr
3-
from .helpers.os_ops_descrsimportOsOpsDescrs
4-
from .helpers.os_ops_descrsimportOsOperations
2+
from .helpers.global_dataimportOsOpsDescr
3+
from .helpers.global_dataimportOsOpsDescrs
4+
from .helpers.global_dataimportOsOperations
55
from .helpers.run_conditionsimportRunConditions
66

77
importos

‎tests/test_os_ops_local.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coding: utf-8
2-
from .helpers.os_ops_descrsimportOsOpsDescrs
3-
from .helpers.os_ops_descrsimportOsOperations
2+
from .helpers.global_dataimportOsOpsDescrs
3+
from .helpers.global_dataimportOsOperations
44

55
importos
66

‎tests/test_os_ops_remote.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

3-
from .helpers.os_ops_descrsimportOsOpsDescrs
4-
from .helpers.os_ops_descrsimportOsOperations
3+
from .helpers.global_dataimportOsOpsDescrs
4+
from .helpers.global_dataimportOsOperations
55

66
from ..testgresimportExecUtilException
77

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp