Ejemplo n.º 1
0
 def test_e102(self):
     # check file
     errors = hint.check_file('tests/md/E102.md', format='text')
     errors = errors.split('\n\n')
     self.assertEqual(len(errors), 1)
     for e in errors:
         e = e.split('\n')
         self.assertEqual(len(e), 2 + 1)
     # ignore
     errors = hint.check_file('tests/md/E102.md', ignore='E102')
     self.assertEqual(len(errors.get('tests/md/E102.md', [])), 0)
Ejemplo n.º 2
0
    def test_e205_json(self):
        # check file
        errors = hint.check_file('tests/md/E205.md')
        self.assertEqual(len(errors), 1)
        self.assertEqual(len(errors.get('tests/md/E205.md', [])), 2)
        for e in errors.get('tests/md/E205.md', []):
            self.assertEqual(e.get('code'), 'E205')

        # ignore
        errors = hint.check_file('tests/md/E205.md', ignore='E205')

        self.assertEqual(len(errors.get('tests/md/E205.md', [])), 0)
Ejemplo n.º 3
0
 def test_e203_text(self):
     # check file
     errors = hint.check_file('tests/md/E203.md', format='text')
     errors = errors.split('\n\n')
     self.assertEqual(len(errors), 1)
     errors = errors[0].split('\n')
     self.assertEqual(len(errors), 3)
     # ignore
     errors = hint.check_file('tests/md/E203.md',
                              format='text',
                              ignore='E203')
     self.assertEqual(errors.strip(), '')
Ejemplo n.º 4
0
 def test_e103(self):
     # check file
     errors = hint.check_file('tests/md/E103.md', format='json')
     self.assertEqual(len(errors), 1)
     errors = errors.get('tests/md/E103.md', [])
     self.assertEqual(len(errors), 5)
     for e in errors:
         self.assertEqual(e.get('code'), 'E103')
     # ignore
     errors = hint.check_file('tests/md/E103.md',
                              ignore='E103',
                              format='text')
     self.assertEqual(errors.strip(), '')