Debian Codegraph @

rpython/config/test/test_parse.py

raw symbols SCIP
1 from rpython.config.parse import parse_info
2
3
4 def test_parse_new_format():
5 assert (parse_info("[foo]\n"
6 " bar = True\n")
7 == {'foo.bar': True})
8
9 assert (parse_info("[objspace]\n"
10 " x = 'hello'\n"
11 "[translation]\n"
12 " bar = 42\n"
13 " [egg]\n"
14 " something = None\n"
15 " foo = True\n")
16 == {
17 'translation.foo': True,
18 'translation.bar': 42,
19 'translation.egg.something': None,
20 'objspace.x': 'hello',
21 })
22
23 assert parse_info("simple = 43\n") == {'simple': 43}
24
25
26 def test_parse_old_format():
27 assert (parse_info(" objspace.allworkingmodules: True\n"
28 " objspace.disable_call_speedhacks: False\n"
29 " objspace.extmodules: None\n"
30 " objspace.std.prebuiltintfrom: -5\n")
31 == {
32 'objspace.allworkingmodules': True,
33 'objspace.disable_call_speedhacks': False,
34 'objspace.extmodules': None,
35 'objspace.std.prebuiltintfrom': -5,
36 })