Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profusion-mobi.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tQ4OsJGe+rjlrGDRrSInRayskql27SN8XAMex1FICHU=; b=IEqhHApMIyZw3gZ8n6dpUNKDunqiElSTAhJBxFKnlTJsa6CohyGCjUY9X9ztTmdk0n x3utCJL8yT0E5FpGfBXQroiijLOhyXRsyw+uSb8pckpX4E7EQXFnADx/mROpn3e5YzkB pqI7J4GI32kZTOCY38M6JER1snB3vZIWcx3B7xPW9/auO4y5kTTmBCh7oiYeWGONXsq2 LBixBx32ctE273wa3/D6EV3ufsGmQhctSA8ukPvg+8Rrtxmr/Saf0BoUNOq4e2mhhJC1 /4UZ8dZxXwoh116bpw7qP8Xjci/tSkzhaHQN0QIB7M5S62twvYZ44txDQWrRFEbaqk98 WdSA== From: Guilherme Campos Camargo Date: Tue, 3 Apr 2018 14:56:50 -0300 Message-Id: <20180403175653.5458-6-guicc@profusion.mobi> In-Reply-To: <20180403175653.5458-1-guicc@profusion.mobi> References: <20180403175653.5458-1-guicc@profusion.mobi> Subject: [Fuego] [PATCH 5/8] Use '+' on long wrapped strings to show contatenation explicitly List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fuego@lists.linuxfoundation.org Improves readability by explicitly showing that strings are being concatenated with the '+' operator. Signed-off-by: Guilherme Campos Camargo --- .../Functional.fuego_release_test/test_run.py | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/engine/tests/Functional.fuego_release_test/test_run.py b/engine/tests/Functional.fuego_release_test/test_run.py index 1b4b62e..873ca21 100755 --- a/engine/tests/Functional.fuego_release_test/test_run.py +++ b/engine/tests/Functional.fuego_release_test/test_run.py @@ -100,7 +100,7 @@ class Visit(SeleniumCommand): r = requests.get(self.url) if r.status_code != self.expected_result: - LOGGER.debug(" HTTP Status Code '%s' is different " + LOGGER.debug(" HTTP Status Code '%s' is different " + "from the expected '%s'", r.status_cod, self.url) return False @@ -188,14 +188,14 @@ class ShExpect(): out = self.client.match.group(1) if result != self.expected_result: - LOGGER.error("The command '%s' returned the code '%d', " - "but the expected code is '%d'" + LOGGER.error("The command '%s' returned the code '%d', " + + "but the expected code is '%d'" + "\nCommand output: '%s'", self.cmd, result, self.expected_result, out) return False if self.expected_output is not None and \ re.search(self.expected_output, out) is None: - LOGGER.error("Wrong output for command '%s'. " + LOGGER.error("Wrong output for command '%s'. " + "Expected '%s'\nReceived '%s'", self.cmd, self.expected_output, out) return False @@ -268,7 +268,7 @@ class FuegoContainer: mount['source'] = None cmd = './{} {}'.format(self.install_script, self.image_name) - LOGGER.debug("Running '%s' to install the docker image. " + LOGGER.debug("Running '%s' to install the docker image. " + "This may take a while....", cmd) status = subprocess.call(cmd, shell=True) @@ -420,7 +420,7 @@ class PexpectContainerSession(): container_addr = self.container.get_ip() if container_addr is None: return False - LOGGER.debug("Trying to reach jenkins at container '%s' via " + LOGGER.debug("Trying to reach jenkins at container '%s' via " + "the container's IP '%s' at port '%d'", self.container.container_name, container_addr, self.container.jenkins_port) @@ -490,38 +490,38 @@ def main(): parser = argparse.ArgumentParser() parser.add_argument('working_dir', help="The working directory", type=str) parser.add_argument('-s', '--install-script', - help="The script that will be used to install the " + help="The script that will be used to install the " + "docker image. Defaults to '{}'" .format(DEFAULT_INSTALL_SCRIPT), default=DEFAULT_INSTALL_SCRIPT, type=str) parser.add_argument('-a', '--start-script', - help="The script used to start the container. " + help="The script used to start the container. " + "Defaults to '{}'" .format(DEFAULT_START_SCRIPT), default=DEFAULT_START_SCRIPT, type=str) parser.add_argument('-i', '--image-name', default=DEFAULT_IMAGE_NAME, - help="The image name that should be used. " + help="The image name that should be used. " + "Defaults to '{}'" .format(DEFAULT_IMAGE_NAME), type=str) parser.add_argument('-c', '--container-name', default=DEFAULT_CONTAINER_NAME, - help="The container name that should be used for the " - "test. Defaults to '{}'" + help="The container name that should be used for " + + "the test. Defaults to '{}'" .format(DEFAULT_CONTAINER_NAME), type=str) - parser.add_argument('-t', '--timeout', help="The timeout value for " + parser.add_argument('-t', '--timeout', help="The timeout value for " + "commands. Defaults to {}" .format(DEFAULT_TIMEOUT), default=DEFAULT_TIMEOUT, type=int) parser.add_argument('-j', '--jenkins-port', - help="The port where the jenkins is running on the " + help="The port where the jenkins is running on the " + "test container. Defaults to {}" .format(DEFAULT_JENKINS_PORT), default=DEFAULT_JENKINS_PORT, type=int) parser.add_argument('--no-rm-container', - help="Do not remove the container after tests are " + help="Do not remove the container after tests are " + "complete.", dest='rm_test_container', default=True, action='store_false') @@ -576,7 +576,8 @@ def main(): # Start a Test through Jenkins UI (Xpath) Click(By.XPATH, - '//img[@title="Schedule a build for docker.default.Functional.hello_world"]'), + '//img[@title="Schedule a build for ' + + 'docker.default.Functional.hello_world"]'), CheckText(By.ID, 'executors', text='docker.default.Functional.hello_world'), ] -- 2.16.3