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_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])