예제 #1
0
 def test_get_(self, workflow, key):
     build = getattr(workflow, snake(f'get_{key}'))()
     if key == 'lastUnstableBuild':
         assert build is None
     else:
         assert isinstance(build, WorkflowRun)
         assert build.url == workflow.api_json()[key]['url']
예제 #2
0
 def test_enable_disable(self, jenkins, mock_resp, action):
     req_url = f'{jenkins.system.url}{action}'
     mock_resp.add('POST', req_url)
     getattr(jenkins.system, snake(action))()
     assert mock_resp.calls[0].request.url == req_url
예제 #3
0
 def test_attrs(self, jenkins):
     expected = []
     for k, v in jenkins.api_json().items():
         if isinstance(v, (int, str, bool, type(None))):
             expected.append(snake(k))
     assert sorted(expected) == sorted(jenkins.dynamic_attrs)