File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def test_branch(self):
37
37
assert repository is not None
38
38
branch = repository .branch ('develop' )
39
39
assert isinstance (branch , github3 .repos .branch .Branch )
40
- assert branch . protection [ 'enabled' ]
40
+ assert 'enabled' in branch . protection
41
41
42
42
def test_branches (self ):
43
43
"""Test the ability to retrieve the branches in a repository."""
@@ -54,11 +54,8 @@ def test_protected_branches(self):
54
54
with self .recorder .use_cassette (cassette_name ):
55
55
repository = self .gh .repository ('sigmavirus24' , 'github3.py' )
56
56
assert repository is not None
57
- found = False
58
- for branch in repository .branches (protected = True ):
59
- assert branch .protection ['enabled' ]
60
- found = True
61
- assert found
57
+ assert all (b .protection ['enabled' ] is True
58
+ for b in repository .branches (protected = True ))
62
59
63
60
def test_code_frequency (self ):
64
61
"""Test the ability to retrieve the code frequency in a repo."""
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ def test_branch(self):
85
85
86
86
b = self .repo .branch ('master' )
87
87
assert isinstance (b , repos .branch .Branch )
88
- assert b .protection
88
+ assert 'enabled' in b .protection
89
89
self .mock_assertions ()
90
90
91
91
assert repr (b ) == '<Repository Branch [master]>'
You can’t perform that action at this time.
0 commit comments