MCPcopy Create free account
hub / github.com/libgit2/pygit2 / test_read

Function test_read

test/test_config.py:106–121  ·  view source on GitHub ↗
(config: Config)

Source from the content-addressed store, hash-verified

104
105
106def test_read(config: Config) -> None:
107 with pytest.raises(TypeError):
108 config[()] # type: ignore
109 with pytest.raises(TypeError):
110 config[-4] # type: ignore
111 utils.assertRaisesWithArg(
112 ValueError, "invalid config item name 'abc'", lambda: config['abc']
113 )
114 utils.assertRaisesWithArg(KeyError, 'abc.def', lambda: config['abc.def'])
115
116 assert 'core.bare' in config
117 assert not config.get_bool('core.bare')
118 assert 'core.editor' in config
119 assert config['core.editor'] == 'ed'
120 assert 'core.repositoryformatversion' in config
121 assert config.get_int('core.repositoryformatversion') == 0
122
123
124def test_write(config: Config) -> None:

Callers

nothing calls this directly

Calls 2

get_boolMethod · 0.80
get_intMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…