mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-2.2' into cassandra-3.0
This commit is contained in:
commit
1d28a4acf8
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -523,26 +523,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"')
|
||||
|
|
|
|||
Loading…
Reference in New Issue