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

Function test_add_all

test/test_index.py:82–113  ·  view source on GitHub ↗
(testrepo: Repository)

Source from the content-addressed store, hash-verified

80
81
82def test_add_all(testrepo: Repository) -> None:
83 clear(testrepo)
84
85 sha_bye = '0907563af06c7464d62a70cdd135a6ba7d2b41d8'
86 sha_hello = 'a520c24d85fbfc815d385957eed41406ca5a860b'
87
88 index = testrepo.index
89 index.add_all(['*.txt'])
90
91 assert 'bye.txt' in index
92 assert 'hello.txt' in index
93
94 assert index['bye.txt'].id == sha_bye
95 assert index['hello.txt'].id == sha_hello
96
97 clear(testrepo)
98
99 index.add_all(['bye.t??', 'hello.*'])
100 assert 'bye.txt' in index
101 assert 'hello.txt' in index
102
103 assert index['bye.txt'].id == sha_bye
104 assert index['hello.txt'].id == sha_hello
105
106 clear(testrepo)
107
108 index.add_all(['[byehlo]*.txt'])
109 assert 'bye.txt' in index
110 assert 'hello.txt' in index
111
112 assert index['bye.txt'].id == sha_bye
113 assert index['hello.txt'].id == sha_hello
114
115
116def test_add_all_aspath(testrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 2

clearFunction · 0.85
add_allMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…