Exemple #1
0
    def test_config_on(self):
        '''Check for newlines around a block including comments.'''
        config.reset()
        config.register_setting(config.COMMENT_KEY, lambda: True)
        config.register_setting(config.WHITESPACE_KEY, lambda: True)

        code = textwrap.dedent(
            '''\

            thing = 8
            |start|

            #


            if False:
                pass
                |cursor|
            else:
                # info here
                # and there


                print('asdds')

            |end|
            # asdfasdf


            print('asdf')
            '''
        )

        self.compare(code, two_way=True, extra_lines=True)
Exemple #2
0
    def test_config_off(self):
        '''Get only the block.'''
        config.reset()
        config.register_setting(config.COMMENT_KEY, lambda: False)
        config.register_setting(config.WHITESPACE_KEY, lambda: False)

        code = textwrap.dedent(
            '''\

            thing = 8


            #


            |start|if False:
                pass
                |cursor|
            else:
                # info here
                # and there


                print('asdds')|end|

            # asdfasdf



            print('asdf')
            '''
        )

        self.compare(code, two_way=True, extra_lines=False)
Exemple #3
0
 def setUp(self):
     '''Reset the configuration to some reasonable default settings.'''
     super(BlocksExtraLinesOn, self).setUp()
     config.reset()
     config.register_setting(config.COMMENT_KEY, lambda: False)
     config.register_setting(config.WHITESPACE_KEY, lambda: False)
Exemple #4
0
 def setUp(self):
     '''Reset the configuration to some reasonable default settings.'''
     super(General, self).setUp()
     config.reset()
 def setUp(self):
     '''Reset the user's config before every test.'''
     super(Blocks, self).setUp()
     config.reset()
Exemple #6
0
 def setUp(self):
     '''Reset the stored settings before each test runs.'''
     super(TooManyLines, self).setUp()
     config.reset()