Ejemplo n.º 1
0
    def test_is_text_file_BinaryFile_False(self):
        filepath = self._get_file_path()
        with open(filepath, "wb") as f:
            f.write("\a\0")

        self.assertFalse(fileutil.is_text_file(filepath))
Ejemplo n.º 2
0
    def test_is_text_file_TextFile_True(self):
        filepath = self._get_file_path()
        with open(filepath, "w") as f:
            f.write("abc")

        self.assertTrue(fileutil.is_text_file(filepath))