def test_create_client_2(self,proxy): """ create a proxy client on the default port """ # make sure the potential client port is not occupied assert not is_port_listening("localhost",proxy.port+1) # start the client proxy_client = proxy.create_client(proxy.port+1) assert is_port_listening("localhost",proxy.port+1)
def test_stop_1(self): """ stop the proxy server at the end of the process the following should be true: 1. hubcheck.conf.settings.proxy is None 2. proxy.port is not listening """ proxy = Proxy() proxy.start() proxy.stop() assert hubcheck.conf.settings.proxy is None assert is_port_listening('localhost',proxy.port) is False
def test_start_1(self): """ setup a new proxy server with valid inputs and start it at the end of the process the following should be true: 1. hubcheck.conf.settings.proxy is not None 2. proxy.port is listening 3. /tmp/userAgentString.properties is populated 4. /tmp/userAgentString.txt is populated """ assert hubcheck.conf.settings.proxy is None proxy = Proxy() proxy.start() assert hubcheck.conf.settings.proxy is not None assert is_port_listening('localhost',proxy.port) is True assert os.path.isfile('/tmp/userAgentString.properties') assert os.path.isfile('/tmp/userAgentString.txt')