Statistics
| Revision:

gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / pylint / test / unittest_checker_misc.py @ 745

History | View | Annotate | Download (1.58 KB)

1
# Copyright 2013 Google Inc. All Rights Reserved.
2
#
3
# This program is free software; you can redistribute it and/or modify it under
4
# the terms of the GNU General Public License as published by the Free Software
5
# Foundation; either version 2 of the License, or (at your option) any later
6
# version.
7
#
8
# This program is distributed in the hope that it will be useful, but WITHOUT
9
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
11
#
12
# You should have received a copy of the GNU General Public License along with
13
# this program; if not, write to the Free Software Foundation, Inc.,
14
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
"""Tests for the misc checker."""
16

    
17
import unittest
18

    
19
from pylint.checkers import misc
20
from pylint.testutils import (
21
    CheckerTestCase, Message,
22
    set_config, create_file_backed_module,
23
)
24

    
25

    
26

    
27
class FixmeTest(CheckerTestCase):
28
    CHECKER_CLASS = misc.EncodingChecker
29

    
30
    def test_fixme(self):
31
        with create_file_backed_module(
32
            """a = 1
33
            # FIXME """) as module:
34
            with self.assertAddsMessages(
35
                Message(msg_id='fixme', line=2, args=u'FIXME')):
36
                self.checker.process_module(module)
37

    
38
    @set_config(notes=[])
39
    def test_empty_fixme_regex(self):
40
        with create_file_backed_module(
41
            """a = 1
42
            # fixme
43
            """) as module:
44
            with self.assertNoMessages():
45
                self.checker.process_module(module)
46

    
47

    
48
if __name__ == '__main__':
49
    unittest.main()