diff options
| author | Darik Gamble <darik.gamble@gmail.com> | 2015-02-09 12:13:20 -0500 |
|---|---|---|
| committer | Darik Gamble <darik.gamble@gmail.com> | 2015-02-09 12:59:36 -0500 |
| commit | 4b13d3907fc0f6101a1a5dcf4a0f87ecca4dcdd2 (patch) | |
| tree | c9763045e5de479e334c3401a7448985b59f6c22 | |
| parent | eb6ee3cade7a0ebbb45ddeae29a50fcb1405c5ae (diff) | |
| download | sqlparse-4b13d3907fc0f6101a1a5dcf4a0f87ecca4dcdd2.tar.gz | |
Fix test
In this test, "(y2) bar" was previously parsed as <Parens "y2"><whitespace><Name bar>,
Similarly (x3) x2 was <Parens><whitespace><Name x2>,
now <Identifier alias x2>. Change the number of top level tokens and nested token
indexing to match.
| -rw-r--r-- | tests/test_grouping.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/test_grouping.py b/tests/test_grouping.py index 44a8072..23dba6d 100644 --- a/tests/test_grouping.py +++ b/tests/test_grouping.py @@ -15,11 +15,12 @@ class TestGrouping(TestCaseBase): s = 'select (select (x3) x2) and (y2) bar' parsed = sqlparse.parse(s)[0] self.ndiffAssertEqual(s, str(parsed)) - self.assertEqual(len(parsed.tokens), 9) + self.assertEqual(len(parsed.tokens), 7) self.assert_(isinstance(parsed.tokens[2], sql.Parenthesis)) - self.assert_(isinstance(parsed.tokens[-3], sql.Parenthesis)) - self.assertEqual(len(parsed.tokens[2].tokens), 7) - self.assert_(isinstance(parsed.tokens[2].tokens[3], sql.Parenthesis)) + self.assert_(isinstance(parsed.tokens[-1], sql.Identifier)) + self.assertEqual(len(parsed.tokens[2].tokens), 5) + self.assert_(isinstance(parsed.tokens[2].tokens[3], sql.Identifier)) + self.assert_(isinstance(parsed.tokens[2].tokens[3].tokens[0], sql.Parenthesis)) self.assertEqual(len(parsed.tokens[2].tokens[3].tokens), 3) def test_comments(self): |
