diff options
| author | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-03-28 19:43:14 -0500 |
|---|---|---|
| committer | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-03-28 19:43:14 -0500 |
| commit | 7de8a058dd79cf2be65530402089aec8cca61b2c (patch) | |
| tree | afb9dad5a1429c5f5e198864d72372a0dc1138c5 | |
| parent | 698af805143475d2fb340e97c106ae9b2112afbe (diff) | |
| download | flake8-7de8a058dd79cf2be65530402089aec8cca61b2c.tar.gz | |
Add unit test for build_ast
| -rw-r--r-- | tests/unit/test_file_processor.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit/test_file_processor.py b/tests/unit/test_file_processor.py index bfa3e55..fba104a 100644 --- a/tests/unit/test_file_processor.py +++ b/tests/unit/test_file_processor.py @@ -1,4 +1,5 @@ """Tests for the FileProcessor class.""" +import ast import optparse from flake8 import processor @@ -156,3 +157,13 @@ def test_split_line(unsplit_line, expected_lines): assert expected_lines == actual_lines assert len(actual_lines) == file_processor.line_number + + +def test_build_ast(): + """Verify the logic for how we build an AST for plugins.""" + file_processor = processor.FileProcessor('-', options_from(), lines=[ + 'a = 1\n' + ]) + + module = file_processor.build_ast() + assert isinstance(module, ast.Module) |
