Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A84D5109AF for ; Fri, 23 Oct 2015 18:00:04 +0000 (UTC) Received: (qmail 62259 invoked by uid 500); 23 Oct 2015 17:59:54 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 62139 invoked by uid 500); 23 Oct 2015 17:59:54 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 61835 invoked by uid 99); 23 Oct 2015 17:59:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Oct 2015 17:59:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 898F6E03CE; Fri, 23 Oct 2015 17:59:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jmckenzie@apache.org To: commits@cassandra.apache.org Date: Fri, 23 Oct 2015 17:59:56 -0000 Message-Id: <7a252ff491294246934a2725265a0b8b@git.apache.org> In-Reply-To: <5f5023bf35f6445ba843330c5b454ff8@git.apache.org> References: <5f5023bf35f6445ba843330c5b454ff8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [03/10] cassandra git commit: Make cqlsh tests work when authentication is configured Make cqlsh tests work when authentication is configured Patch by stefania; reviewed by aholmberg for CASSANDRA-10544 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/34b8d8fc Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/34b8d8fc Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/34b8d8fc Branch: refs/heads/cassandra-3.0 Commit: 34b8d8fcbf528f21ac7869685e33214af381265c Parents: 5a1d376 Author: Stefania Alborghetti Authored: Fri Oct 23 13:58:19 2015 -0400 Committer: Joshua McKenzie Committed: Fri Oct 23 13:58:19 2015 -0400 ---------------------------------------------------------------------- pylib/cqlshlib/test/run_cqlsh.py | 2 +- pylib/cqlshlib/test/test_cqlsh_output.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/34b8d8fc/pylib/cqlshlib/test/run_cqlsh.py ---------------------------------------------------------------------- diff --git a/pylib/cqlshlib/test/run_cqlsh.py b/pylib/cqlshlib/test/run_cqlsh.py index 88b0ca6..cc929e1 100644 --- a/pylib/cqlshlib/test/run_cqlsh.py +++ b/pylib/cqlshlib/test/run_cqlsh.py @@ -27,7 +27,7 @@ import math from time import time from . import basecase -DEFAULT_CQLSH_PROMPT = '\ncqlsh(:\S+)?> ' +DEFAULT_CQLSH_PROMPT = os.linesep + '(\S+@)?cqlsh(:\S+)?> ' DEFAULT_CQLSH_TERM = 'xterm' cqlshlog = basecase.cqlshlog http://git-wip-us.apache.org/repos/asf/cassandra/blob/34b8d8fc/pylib/cqlshlib/test/test_cqlsh_output.py ---------------------------------------------------------------------- diff --git a/pylib/cqlshlib/test/test_cqlsh_output.py b/pylib/cqlshlib/test/test_cqlsh_output.py index 64950e2..e3af8e8 100644 --- a/pylib/cqlshlib/test/test_cqlsh_output.py +++ b/pylib/cqlshlib/test/test_cqlsh_output.py @@ -522,26 +522,26 @@ class TestCqlshOutput(BaseTestCase): def test_prompt(self): with testrun_cqlsh(tty=True, keyspace=None, cqlver=cqlsh.DEFAULT_CQLVER) as c: - self.assertEqual(c.output_header.splitlines()[-1], 'cqlsh> ') + self.assertTrue(c.output_header.splitlines()[-1].endswith('cqlsh> ')) c.send('\n') output = c.read_to_next_prompt().replace('\r\n', '\n') - self.assertEqual(output, '\ncqlsh> ') + self.assertTrue(output.endswith('cqlsh> ')) cmd = "USE \"%s\";\n" % get_test_keyspace().replace('"', '""') c.send(cmd) output = c.read_to_next_prompt().replace('\r\n', '\n') - self.assertEqual(output, '%scqlsh:%s> ' % (cmd, get_test_keyspace())) + self.assertTrue(output.endswith('cqlsh:%s> ' % (get_test_keyspace()))) c.send('use system;\n') output = c.read_to_next_prompt().replace('\r\n', '\n') - self.assertEqual(output, 'use system;\ncqlsh:system> ') + self.assertTrue(output.endswith('cqlsh:system> ')) c.send('use NONEXISTENTKEYSPACE;\n') outputlines = c.read_to_next_prompt().splitlines() self.assertEqual(outputlines[0], 'use NONEXISTENTKEYSPACE;') - self.assertEqual(outputlines[2], 'cqlsh:system> ') + self.assertTrue(outputlines[2].endswith('cqlsh:system> ')) midline = ColoredText(outputlines[1]) self.assertEqual(midline.plain(), 'InvalidRequest: code=2200 [Invalid query] message="Keyspace \'nonexistentkeyspace\' does not exist"')