def test_text_file(self):
     print "\nTest: Is it a text file"
     files = [file for file in os.listdir('encoding') if file.endswith('py') or file.endswith('sh') or file.endswith('txt')]
     for file in files:
         file_path = os.path.join('encoding', file)
         try:
             self.assertTrue(cs.is_text_file(file_path)[0])
         except:
             print file
             raise
Esempio n. 2
0
 def test_text_file(self):
     print "\nTest: Is it a text file"
     files = [
         file for file in os.listdir('encoding') if file.endswith('py')
         or file.endswith('sh') or file.endswith('txt')
     ]
     for file in files:
         file_path = os.path.join('encoding', file)
         try:
             self.assertTrue(cs.is_text_file(file_path)[0])
         except:
             print file
             raise
 def test_bin_file(self):
     print "\nTest: Is it a binary file"
     file_path = "encoding/mslogo.png"
     self.assertFalse(cs.is_text_file(file_path)[0])
Esempio n. 4
0
 def test_bin_file(self):
     print "\nTest: Is it a binary file"
     file_path = "encoding/mslogo.png"
     self.assertFalse(cs.is_text_file(file_path)[0])