Пример #1
0
    def test_while_check_for_do(self, m_print_error):
        run = bashate.BashateRun()
        test_line = 'while `do something args`'
        bashate.check_for_do(test_line, run)

        m_print_error.assert_called_once_with(
            'E010: Do not on same line as while', test_line)
Пример #2
0
 def setUp(self):
     super(TestBashateSamples, self).setUp()
     log_error_patcher = mock.patch(
         'bashate.bashate.BashateRun.log_error')
     self.m_log_error = log_error_patcher.start()
     self.run = bashate.BashateRun()
     self.addCleanup(log_error_patcher.stop)
Пример #3
0
    def test_ignore(self):
        run = bashate.BashateRun()
        run.register_ignores('E001')

        bashate.check_no_trailing_whitespace("if ", run)

        self.assertEqual(run.ERRORS, 0)
Пример #4
0
 def setUp(self):
     super(TestBashate, self).setUp()
     self.run = bashate.BashateRun()