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

Commit66860d0

Browse files
TestgresTests::test_ports_management is corrected
Let's send warning about a garbage in the container "bound_ports" and continue working.
1 parente4e8909 commit66860d0

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

‎tests/test_simple.py‎

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

920920
deftest_ports_management(self):
921-
# check that no ports have been bound yet
922-
assert (len(bound_ports)==0)
921+
assertbound_portsisnotNone
922+
asserttype(bound_ports)==set# noqa: E721
923+
924+
iflen(bound_ports)!=0:
925+
logging.warning("bound_ports is not empty: {0}".format(bound_ports))
926+
927+
stage0__bound_ports=bound_ports.copy()
923928

924929
withget_new_node()asnode:
925-
# check that we've just bound a port
926-
assert (len(bound_ports)==1)
930+
assertbound_portsisnotNone
931+
asserttype(bound_ports)==set# noqa: E721
932+
933+
assertnode.portisnotNone
934+
asserttype(node.port)==int# noqa: E721
935+
936+
logging.info("node port is {0}".format(node.port))
937+
938+
assertnode.portinbound_ports
939+
assertnode.portnotinstage0__bound_ports
940+
941+
assertstage0__bound_ports<=bound_ports
942+
assertlen(stage0__bound_ports)+1==len(bound_ports)
943+
944+
stage1__bound_ports=stage0__bound_ports.copy()
945+
stage1__bound_ports.add(node.port)
927946

928-
# check that bound_ports contains our port
929-
port_1=list(bound_ports)[0]
930-
port_2=node.port
931-
assert (port_1==port_2)
947+
assertstage1__bound_ports==bound_ports
932948

933949
# check that port has been freed successfully
934-
assert (len(bound_ports)==0)
950+
assertbound_portsisnotNone
951+
asserttype(bound_ports)==set# noqa: E721
952+
assertbound_ports==stage0__bound_ports
935953

936954
deftest_exceptions(self):
937955
str(StartNodeException('msg', [('file','lines')]))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp