Esempio n. 1
0
 def test_no_vi_headers(self):
     # NOTE(mtreinish)  The lines parameter is used only for finding the
     # line location in the file. So these tests just pass a list of an
     # arbitrary length to use for verifying the check function.
     self.assertTrue(checks.no_vi_headers("# vim: tabstop=4 shiftwidth=4 softtabstop=4", 1, range(250)))
     self.assertTrue(checks.no_vi_headers("# vim: tabstop=4 shiftwidth=4 softtabstop=4", 249, range(250)))
     self.assertFalse(checks.no_vi_headers("# vim: tabstop=4 shiftwidth=4 softtabstop=4", 149, range(250)))
Esempio n. 2
0
 def test_no_vi_headers(self):
     # NOTE(mtreinish)  The lines parameter is used only for finding the
     # line location in the file. So these tests just pass a list of an
     # arbitrary length to use for verifying the check function.
     self.assertTrue(checks.no_vi_headers(
         '# vim: tabstop=4 shiftwidth=4 softtabstop=4', 1, range(250)))
     self.assertTrue(checks.no_vi_headers(
         '# vim: tabstop=4 shiftwidth=4 softtabstop=4', 249, range(250)))
     self.assertFalse(checks.no_vi_headers(
         '# vim: tabstop=4 shiftwidth=4 softtabstop=4', 149, range(250)))