File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ # -*- coding: shift_jis -*-
2+
3+ from .imported import ƒÎ
Original file line number Diff line number Diff line change @@ -19,3 +19,23 @@ def test_build_graph_of_non_ascii_source():
1919 "line_contents" : "from .imported import π" ,
2020 },
2121 ] == result
22+
23+
24+ def test_build_graph_of_non_utf8_source ():
25+ """
26+ Tests we can cope with non UTF-8 Python source files.
27+ """
28+ graph = grimp .build_graph ("encodingpackage" , cache_dir = None )
29+
30+ result = graph .get_import_details (
31+ importer = "encodingpackage.shift_jis_importer" , imported = "encodingpackage.imported"
32+ )
33+
34+ assert [
35+ {
36+ "importer" : "encodingpackage.shift_jis_importer" ,
37+ "imported" : "encodingpackage.imported" ,
38+ "line_number" : 3 ,
39+ "line_contents" : "from .imported import π" ,
40+ },
41+ ] == result
You can’t perform that action at this time.
0 commit comments