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