Advertisement
lenkaseg

fork.py test

Feb 13th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.15 KB | None | 0 0
  1.     @patch('pagure.lib.notify.send_email', MagicMock(return_value=True))
  2.     def test_api_pull_request_open_from_branch_to_origin(self):
  3.         """Test the api_pull_request_create method from a fork to a master,
  4.        with project token of a origin with all the acls"""
  5.         tests.setup_for_my_function(self.session)
  6.         tests.add_readme_git_repo(os.path.join(self.path, 'repos', 'fork',
  7.             'pingou', 'vegetable.git'))
  8.         tests.add_commit_git_repo(os.path.join(self.path, 'repos', 'fork',
  9.             'pingou', 'vegetable.git'), branch='branch')
  10.         tests.create_tokens_acl(self.session, token_id='iamparenttoken')
  11.         tests.create_tokens_acl(self.session, token_id='iamforktoken')
  12.          
  13.         headers = {'Authorization': 'token iamforktoken'}
  14.        
  15.         data = {
  16.             'title': 'war of tomatoes',
  17.             'repo': 'vegetable',
  18.             'initial_comment': 'the manifest',
  19.             'branch_to': 'master',
  20.             'branch_from': 'branch',
  21.             }
  22.  
  23.         output = self.app.post('/api/0/vegetable/pull-request/new', headers=headers)
  24.         self.assertEqual(output.status_code, 200)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement