Example #1
0
def test_guess_encoding_iso8859():
    assert File.guess_encoding(TEST_ISO8859_PATH) == 'iso-8859-1'
Example #2
0
 def encoding(self):
     if not hasattr(self, "_encoding"):
         self._encoding = File.guess_encoding(self.path)
     return self._encoding
Example #3
0
def test_guess_encoding_ascii():
    assert File.guess_encoding(TEST_ASCII_PATH) == 'us-ascii'
Example #4
0
def test_guess_encoding_unicode():
    assert File.guess_encoding(TEST_UNICODE_PATH) == 'utf-8'
Example #5
0
 def encoding(self):
     if not hasattr(self, '_encoding'):
         self._encoding = File.guess_encoding(self.path)
     return self._encoding
Example #6
0
def test_guess_encoding_binary():
    assert File.guess_encoding(TEST_FILE1_PATH) == 'binary'
Example #7
0
def test_guess_encoding_iso8859():
    assert File.guess_encoding(TEST_ISO8859_PATH) == 'iso-8859-1'
Example #8
0
def test_guess_encoding_unicode():
    assert File.guess_encoding(TEST_UNICODE_PATH) == 'utf-8'
Example #9
0
def test_guess_encoding_ascii():
    assert File.guess_encoding(TEST_ASCII_PATH) == 'us-ascii'
Example #10
0
def test_guess_encoding_binary():
    assert File.guess_encoding(TEST_FILE1_PATH) == 'binary'
Example #11
0
 def encoding(self):
     if not hasattr(self, '_encoding'):
         with self.get_content():
             self._encoding = File.guess_encoding(self.path)
     return self._encoding