File tree 3 files changed +8
-8
lines changed
rabbitmq_amqp_python_client/qpid/proton
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change
1
+ # type: ignore
2
+
1
3
from rabbitmq_amqp_python_client import (
2
4
BindingSpecification ,
3
5
Connection ,
@@ -84,11 +86,9 @@ def main() -> None:
84
86
print ("unbind" )
85
87
management .unbind (bind_name )
86
88
87
-
88
-
89
89
consumer .close ()
90
90
print ("delete queue" )
91
- #management.delete_queue(queue_name)
91
+ # management.delete_queue(queue_name)
92
92
93
93
print ("delete exchange" )
94
94
management .delete_exchange (exchange_name )
Original file line number Diff line number Diff line change @@ -273,8 +273,6 @@ def __init__(
273
273
if credit :
274
274
receiver .flow (credit )
275
275
276
- if fetcher is None :
277
- print ("fetcher is none" )
278
276
self .fetcher = fetcher
279
277
self .container = connection .container
280
278
Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ def test_publish_exchange(connection: Connection) -> None:
72
72
73
73
74
74
def test_publish_purge (connection : Connection ) -> None :
75
+ connection = Connection ("amqp://guest:guest@localhost:5672/" )
76
+ connection .dial ()
75
77
76
78
queue_name = "test-queue"
77
79
management = connection .management ()
@@ -82,17 +84,17 @@ def test_publish_purge(connection: Connection) -> None:
82
84
83
85
try :
84
86
publisher = connection .publisher ("/queues/" + queue_name )
85
- for i in range (100 ):
87
+ for i in range (20 ):
86
88
publisher .publish (Message (body = "test" ))
87
89
except Exception :
88
90
raised = True
89
91
90
- time .sleep (5 )
92
+ time .sleep (4 )
91
93
92
94
message_purged = management .purge_queue (queue_name )
93
95
94
96
assert raised is False
95
- assert message_purged == 100
97
+ assert message_purged == 20
96
98
97
99
publisher .close ()
98
100
You can’t perform that action at this time.
0 commit comments