Esempio n. 1
0
 def testMissingFileWithMultipleFiles(self):
     ms = misspellings.Misspellings(files=[
         os.path.join(BASE_PATH, 'missing_source_%d.c' % i)
         for i in range(10)
     ])
     errors, results = ms.check()
     self.assertEqual(len(errors), 10)
     self.assertEqual(len(results), 0)
Esempio n. 2
0
 def test_more_complex_file(self):
     ms = misspellings.Misspellings()
     errors, results = ms.check(
         os.path.join(BASE_PATH, 'various_spellings.c'))
     self.assertEqual(len(errors), 0)
     self.assertEqual(len(results), 7)
Esempio n. 3
0
 def test_good_file(self):
     ms = misspellings.Misspellings()
     errors, results = ms.check(
         os.path.join(BASE_PATH, 'nine_mispellings.c'))
     self.assertEqual(len(errors), 0)
     self.assertEqual(len(results), 9)
Esempio n. 4
0
 def test_missing_file(self):
     ms = misspellings.Misspellings()
     errors, results = ms.check(os.path.join(BASE_PATH, 'missing_source.c'))
     self.assertTrue(errors)
Esempio n. 5
0
 def test_broken_ms_list(self):
     with self.assertRaises(ValueError):
         misspellings.Misspellings(os.path.join(BASE_PATH,
                                                'broken_msl.txt'))
Esempio n. 6
0
 def test_missing_ms_list(self):
     with self.assertRaises(IOError):
         misspellings.Misspellings(
             os.path.join(BASE_PATH, 'missing_msl.txt'))
Esempio n. 7
0
 def testMoreComplexFile(self):
     ms = misspellings.Misspellings(
         files=[os.path.join(BASE_PATH, 'various_spellings.c')])
     errors, results = ms.check()
     self.assertEqual(len(errors), 0)
     self.assertEqual(len(results), 7)
Esempio n. 8
0
 def testGoodFile(self):
     ms = misspellings.Misspellings(
         files=[os.path.join(BASE_PATH, 'nine_mispellings.c')])
     errors, results = ms.check()
     self.assertEqual(len(errors), 0)
     self.assertEqual(len(results), 9)
Esempio n. 9
0
 def testMissingFile(self):
     ms = misspellings.Misspellings(
         files=os.path.join(BASE_PATH, 'missing_source.c'))
     errors, results = ms.check()
     self.assertEqual(len(errors), 1)