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

Function test_no_attr

test/test_attributes.py:32–43  ·  view source on GitHub ↗
(testrepo: Repository)

Source from the content-addressed store, hash-verified

30
31
32def test_no_attr(testrepo: Repository) -> None:
33 assert testrepo.get_attr('file', 'foo') is None
34
35 with (Path(testrepo.workdir) / '.gitattributes').open('w+') as f:
36 print('*.py text\n', file=f)
37 print('*.jpg -text\n', file=f)
38 print('*.sh eol=lf\n', file=f)
39
40 assert testrepo.get_attr('file.py', 'foo') is None
41 assert testrepo.get_attr('file.py', 'text')
42 assert not testrepo.get_attr('file.jpg', 'text')
43 assert 'lf' == testrepo.get_attr('file.sh', 'eol')
44
45
46def test_no_attr_aspath(testrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 2

get_attrMethod · 0.80
openMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…