cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcken...@apache.org
Subject [03/10] cassandra git commit: Make cqlsh tests work when authentication is configured
Date Fri, 23 Oct 2015 17:59:56 GMT
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 <stefania.alborghetti@datastax.com>
Authored: Fri Oct 23 13:58:19 2015 -0400
Committer: Joshua McKenzie <jmckenzie@apache.org>
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"')


Mime
View raw message