Refactorred test.
This commit is contained in:
		@@ -20,7 +20,6 @@ class Server:
 | 
				
			|||||||
        self.datadir.mkdir(parents=True)
 | 
					        self.datadir.mkdir(parents=True)
 | 
				
			||||||
        self.settings = {}
 | 
					        self.settings = {}
 | 
				
			||||||
        self.use_config = True
 | 
					        self.use_config = True
 | 
				
			||||||
        # self.env = {}
 | 
					 | 
				
			||||||
        self.process = None
 | 
					        self.process = None
 | 
				
			||||||
        self.loop = get_event_loop()
 | 
					        self.loop = get_event_loop()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -77,12 +76,9 @@ class Server:
 | 
				
			|||||||
    def set_safe_port(self):
 | 
					    def set_safe_port(self):
 | 
				
			||||||
        """Set the server port to something not being used."""
 | 
					        """Set the server port to something not being used."""
 | 
				
			||||||
        port = 9090
 | 
					        port = 9090
 | 
				
			||||||
 | 
					        address = self.base_url.split(":")[0]
 | 
				
			||||||
        while port == 9090:
 | 
					        while port == 9090:
 | 
				
			||||||
            sock = socket()
 | 
					            sock = socket()
 | 
				
			||||||
            if "address" in self.settings:
 | 
					 | 
				
			||||||
                address = self.settings["address"]
 | 
					 | 
				
			||||||
            else:
 | 
					 | 
				
			||||||
                address = "127.0.0.1"
 | 
					 | 
				
			||||||
            sock.bind((address, 0))
 | 
					            sock.bind((address, 0))
 | 
				
			||||||
            port = sock.getsockname()[1]
 | 
					            port = sock.getsockname()[1]
 | 
				
			||||||
            sock.close()
 | 
					            sock.close()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user