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

Function test_valueless_key_iteration

test/test_config.py:188–199  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

186
187
188def test_valueless_key_iteration() -> None:
189 # A valueless key (no `= value`) has a NULL value pointer in libgit2.
190 # Iterating over such entries must not raise a RuntimeError.
191 with open(CONFIG_FILENAME, 'w') as new_file:
192 new_file.write('[section]\n\tvaluelesskey\n\tnormalkey = somevalue\n')
193
194 config = Config()
195 config.add_file(CONFIG_FILENAME, 6)
196
197 entries = {entry.name: entry for entry in config}
198 assert 'section.valuelesskey' in entries
199 assert 'section.normalkey' in entries
200
201
202def test_valueless_key_value() -> None:

Callers

nothing calls this directly

Calls 3

add_fileMethod · 0.95
ConfigClass · 0.90
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…