File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
import pytest
2
2
3
+ import gitlab
4
+
3
5
4
6
@pytest .mark .gitlab_premium
5
7
@pytest .mark .xfail (reason = "need to relax RESTObject init for non-dict responses" )
6
8
def test_project_push_rules (project ):
7
- push_rules = project .pushrules .get ()
8
- assert not push_rules
9
+ with pytest .raises (gitlab .GitlabParsingError ):
10
+ # when no rules are defined the API call returns back `None` which
11
+ # causes a gitlab.GitlabParsingError in RESTObject.__init__()
12
+ project .pushrules .get ()
9
13
10
14
push_rules = project .pushrules .create ({"deny_delete_tag" : True })
11
15
assert push_rules .deny_delete_tag
@@ -18,4 +22,6 @@ def test_project_push_rules(project):
18
22
assert not push_rules .deny_delete_tag
19
23
20
24
push_rules .delete ()
21
- assert not push_rules
25
+
26
+ with pytest .raises (gitlab .GitlabParsingError ):
27
+ project .pushrules .get ()
You can’t perform that action at this time.
0 commit comments