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

Commit3cc1627

Browse files
TestgresRemoteTests::test_ports_management is corrected (#198)
It is synchronized with TestgresTests::test_ports_management.
1 parent6d67da2 commit3cc1627

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

‎tests/test_simple_remote.py

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -976,20 +976,38 @@ def test_isolation_levels(self):
976976
con.begin('Garbage').commit()
977977

978978
deftest_ports_management(self):
979-
# check that no ports have been bound yet
980-
assert (len(bound_ports)==0)
979+
assertbound_portsisnotNone
980+
asserttype(bound_ports)==set# noqa: E721
981+
982+
iflen(bound_ports)!=0:
983+
logging.warning("bound_ports is not empty: {0}".format(bound_ports))
984+
985+
stage0__bound_ports=bound_ports.copy()
981986

982987
with__class__.helper__get_node()asnode:
983-
# check that we've just bound a port
984-
assert (len(bound_ports)==1)
988+
assertbound_portsisnotNone
989+
asserttype(bound_ports)==set# noqa: E721
990+
991+
assertnode.portisnotNone
992+
asserttype(node.port)==int# noqa: E721
993+
994+
logging.info("node port is {0}".format(node.port))
995+
996+
assertnode.portinbound_ports
997+
assertnode.portnotinstage0__bound_ports
998+
999+
assertstage0__bound_ports<=bound_ports
1000+
assertlen(stage0__bound_ports)+1==len(bound_ports)
1001+
1002+
stage1__bound_ports=stage0__bound_ports.copy()
1003+
stage1__bound_ports.add(node.port)
9851004

986-
# check that bound_ports contains our port
987-
port_1=list(bound_ports)[0]
988-
port_2=node.port
989-
assert (port_1==port_2)
1005+
assertstage1__bound_ports==bound_ports
9901006

9911007
# check that port has been freed successfully
992-
assert (len(bound_ports)==0)
1008+
assertbound_portsisnotNone
1009+
asserttype(bound_ports)==set# noqa: E721
1010+
assertbound_ports==stage0__bound_ports
9931011

9941012
deftest_exceptions(self):
9951013
str(StartNodeException('msg', [('file','lines')]))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp