Esempio n. 1
0
 def test_is_content_in_file_without_the_content(self):
     file_to_test = self.test_dir + os.sep + 'WithoutTheContent'
     with open(file_to_test, 'w') as dest:
         dest.write('Nothing in this file')
     result = File.is_content_in_file(file_to_test, 'content')
     self.assertFalse(result)
Esempio n. 2
0
 def test_is_content_in_file_without_content(self):
     file_to_test = self.test_dir + os.sep + 'WithContent'
     with open(file_to_test, 'w') as dest:
         dest.write('Small content in a file')
     result = File.is_content_in_file(file_to_test, 'content')
     self.assertTrue(result)
Esempio n. 3
0
 def test_is_content_in_file_without_file(self):
     file_to_test = self.test_dir + os.sep + 'FileNotFound'
     result = File.is_content_in_file(file_to_test, 'test string')
     self.assertFalse(result)