@@ -418,6 +418,12 @@ class ReactorOptionsTests(SenderReceiverTestCase):
418418class ConnectionOptionsTests (SenderReceiverTestCase ):
419419 """ connection options test group """
420420
421+ def setUp (self ):
422+ """ create connect.json """
423+ f = open ("connect.json" , "w" )
424+ f .write ('{"scheme": "amqp"}' )
425+ f .close ()
426+
421427 def test_auth_mechs_anonymous (self ):
422428 """ tests allowed authentication mechanisms: anonymous """
423429 send_opts = self .get_sender_opts ()
@@ -438,6 +444,10 @@ def test_read_config_file_send_receive_opts(self):
438444 recv_messages = self .run_receiver (recv_opts )
439445 self .assertTrue (len (sent_messages ) == len (recv_messages ) == 1 )
440446
447+ def tearDown (self ):
448+ """ delete connect.json """
449+ os .remove ("connect.json" )
450+
441451@unittest .skip ("test class not implemented yet" )
442452class LinkOptionsTests (SenderReceiverTestCase ):
443453 """ link options test group """
@@ -762,6 +772,12 @@ def test_connect(self):
762772class CommandLineTests (CommandLineTestCase ):
763773 """ command line test group """
764774
775+ def setUp (self ):
776+ """ create connect.json """
777+ f = open ("connect.json" , "w" )
778+ f .write ('{"scheme": "amqp"}' )
779+ f .close ()
780+
765781 def test_send_receive (self ):
766782 """ basic send receive test """
767783 sent_messages = self .run_sender (['--log-msgs' , 'dict' ])
@@ -779,13 +795,9 @@ def test_subscribe(self):
779795
780796 def test_read_config_file_send_receive_cli (self ):
781797 """ basic send receive test with connection configuration file """
782- f = open ("connect.json" , "w" )
783- f .write ('{"scheme": "amqp"}' )
784- f .close ()
785798 sent_messages = self .run_sender (['--log-msgs' , 'dict' , '--conn-use-config-file' ])
786799 recv_messages = self .run_receiver (['--log-msgs' , 'dict' , '--conn-use-config-file' ])
787800 self .assertTrue (len (sent_messages ) == len (recv_messages ) == 1 )
788- os .remove ("connect.json" )
789801
790802 def test_conn_urls_send_receive_cli (self ):
791803 """ basic send receive test with connection urls """
@@ -849,6 +861,9 @@ def test_send_receive_on_release(self):
849861 self .assertEqual (received_msgs , TOTAL_MSGS )
850862 self .assertEqual (released_msgs , RECV_COUNT )
851863
864+ def tearDown (self ):
865+ """ delete connect.json """
866+ os .remove ("connect.json" )
852867
853868# Peer-to-peer tests
854869
0 commit comments