We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 795769e commit 5e4932bCopy full SHA for 5e4932b
tests/unit/test_utils.py
@@ -6,6 +6,7 @@
6
from repo2docker import utils
7
import pytest
8
import subprocess
9
+import tempfile
10
11
12
def test_capture_cmd_no_capture_success():
@@ -112,6 +113,14 @@ def test_normalize_doi():
112
113
assert utils.normalize_doi("http://dx.doi.org/10.1234/jshd123") == "10.1234/jshd123"
114
115
116
+def test_open_guess_encoding():
117
+ data = "Rică nu știa să zică râu, rățușcă, rămurică."
118
+ with tempfile.NamedTemporaryFile(mode='wb') as test_file:
119
+ test_file.write(str.encode(data, "utf-16"))
120
+ test_file.seek(0)
121
+ with utils.open_guess_encoding(test_file.name) as fd:
122
+ assert fd.read() == data
123
+
124
@pytest.mark.parametrize(
125
"req, is_local",
126
[
0 commit comments