Beispiel #1
0
 def testPoorlyPlacedTitle(self):
     with open('buffer.txt', 'w', encoding='utf-8') as self.buffer:
         self.buffer.write('\n\n\t\t\t\t<div></div><h1>Person v. Person - 100 U.S. 25 (2000)</h1>')
     v = Validator('buffer.txt')
     with self.assertRaises(BadTitle, msg='Validator passed a title that was not at the '
                            'beginning of the file.'):
         v.validateTitlePlacement()
Beispiel #2
0
 def testGoodTitlePlacement(self):
     with open('buffer.txt', 'w', encoding='utf-8') as self.buffer:
         self.buffer.write('\n\n\t\t\t\t<h1>Person v. Person - 100 U.S. 25 (2000)</h1>')
     v = Validator('buffer.txt')
     try:
         v.validateTitlePlacement()
     except:
         self.fail('Validator did not pass a good title.')
Beispiel #3
0
 def testNoTitle(self):
     with open('buffer.txt', 'w', encoding='utf-8') as self.buffer:
         self.buffer.write('\n\n\t\t\t')
     v = Validator('buffer.txt')
     with self.assertRaises(BadTitle, msg='Validator passed a file with no title.'):
         v.validateTitlePlacement()