MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / test_weird_encoding

Function test_weird_encoding

tests/test_interface.py:106–121  ·  view source on GitHub ↗

To address https://github.com/scottrogowski/code2flow/issues/28 The windows user had an error b/c their default encoding was cp1252 and they were trying to read a unicode file with emojis I don't have that installed but was able to reproduce by changing to US-ASCII which I assum

()

Source from the content-addressed store, hash-verified

104
105
106def test_weird_encoding():
107 """
108 To address https://github.com/scottrogowski/code2flow/issues/28
109 The windows user had an error b/c their default encoding was cp1252
110 and they were trying to read a unicode file with emojis
111 I don't have that installed but was able to reproduce by changing to
112 US-ASCII which I assume is a little more universal anyway.
113 """
114
115 locale.setlocale(locale.LC_ALL, 'en_US.US-ASCII')
116 code2flow('test_code/py/weird_encoding',
117 output_file='/tmp/code2flow/out.json',
118 hide_legend=False)
119 with open('/tmp/code2flow/out.json') as f:
120 jobj = json.loads(f.read())
121 assert set(jobj.keys()) == {'graph'}
122
123
124def test_repr():

Callers

nothing calls this directly

Calls 3

code2flowFunction · 0.90
setFunction · 0.85
keysMethod · 0.80

Tested by

no test coverage detected