Skip to content

Commit 4023fb1

Browse files
committed
Add tests for unknown dot commands
1 parent 9b3ed39 commit 4023fb1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Lib/test/test_sqlite3/test_cli.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,15 @@ def test_interact_version(self):
116116
self.assertEqual(out.count(self.PS2), 0)
117117
self.assertIn(sqlite3.sqlite_version, out)
118118

119-
def test_interact_dot_commands_whitespace(self):
120-
out, err = self.run_cli(commands=(".version ", ". version"))
119+
def test_interact_dot_commands(self):
120+
# test dot commands with whitespaces and unknow dot commands
121+
out, err = self.run_cli(commands=(".version ", ". version", ".spam"))
121122
self.assertIn(self.MEMORY_DB_MSG, err)
122123
self.assertEqual(out.count(sqlite3.sqlite_version + "\n"), 2)
123124
self.assertEndsWith(out, self.PS1)
124-
self.assertEqual(out.count(self.PS1), 3)
125+
self.assertEqual(out.count(self.PS1), 4)
125126
self.assertEqual(out.count(self.PS2), 0)
126-
self.assertIn(sqlite3.sqlite_version, out)
127+
self.assertIn("Error", out)
127128

128129
def test_interact_valid_sql(self):
129130
out, err = self.run_cli(commands=("SELECT 1;",))

0 commit comments

Comments
 (0)