<s> """<STR_LIT>""" <EOL> import pytest <EOL> from . import helper <EOL> from github3 import GitHubError <EOL> from github3 import pulls <EOL> get_pr_example_data = helper . create_example_data_helper ( <EOL> '<STR_LIT>' <EOL> ) <EOL> url_for = helper . create_url_helper ( <EOL> '<STR_LIT>' <EOL> ) <EOL> class TestPullRequest ( helper . UnitHelper ) : <EOL> """<STR_LIT>""" <EOL> described_class = pulls . PullRequest <EOL> example_data = get_pr_example_data ( ) <EOL> def test_close ( self ) : <EOL> """<STR_LIT>""" <EOL> self . instance . close ( ) <EOL> self . patch_called_with ( <EOL> url_for ( ) , <EOL> data = { <EOL> '<STR_LIT:title>' : self . instance . title , <EOL> '<STR_LIT:body>' : self . instance . body , <EOL> '<STR_LIT:state>' : '<STR_LIT>' <EOL> } <EOL> ) <EOL> def test_create_comment ( self ) : <EOL> """<STR_LIT>""" <EOL> self . instance . create_comment ( '<STR_LIT:body>' ) <EOL> self . post_called_with ( <EOL> url_for ( '<STR_LIT>' ) . replace ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> data = { '<STR_LIT:body>' : '<STR_LIT:body>' } <EOL> ) <EOL> def test_create_review_comment ( self ) : <EOL> """<STR_LIT>""" <EOL> self . instance . create_review_comment ( '<STR_LIT:body>' , '<STR_LIT>' , '<STR_LIT:path>' , <NUM_LIT:6> ) <EOL> self . post_called_with ( <EOL> url_for ( '<STR_LIT>' ) , <EOL> data = { <EOL> '<STR_LIT:body>' : '<STR_LIT:body>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:path>' : '<STR_LIT:path>' , <EOL> '<STR_LIT>' : <NUM_LIT:6> <EOL> } <EOL> ) <EOL> def test_diff ( self ) : <EOL> """<STR_LIT>""" <EOL> self . instance . diff ( ) <EOL> self . session . get . assert_called_once_with ( <EOL> url_for ( ) , <EOL> headers = { '<STR_LIT>' : '<STR_LIT>' } <EOL> ) <EOL> def test_is_merged_request ( self ) : <EOL> """<STR_LIT>""" <EOL> self . instance . merged = False <EOL> self . instance . is_merged ( ) <EOL> self . session . get . assert_called_once_with ( url_for ( '<STR_LIT>' ) ) <EOL> def test_is_merged_no_requset ( self ) : <EOL> """<STR_LIT>""" <EOL> self . instance . merged = True <EOL> assert self . instance . is_merged ( ) <EOL> assert self . session . get . called is False <EOL> def test_issue ( self ) : <EOL> """<STR_LIT>""" <EOL> self . instance . issue ( ) <EOL> self . session . get . assert_called_once_with ( <EOL> url_for ( ) . replace ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> ) <EOL> def test_merge ( self ) : <EOL> """<STR_LIT>""" <EOL> self . instance . merge ( ) <EOL> self . session . put . assert_called_once_with ( <EOL> url_for ( '<STR_LIT>' ) , <EOL> data = '<STR_LIT>' <EOL> ) <EOL> def test_patch ( self ) : <EOL> """<STR_LIT>""" <EOL> self . instance . patch ( ) <EOL> self . session . get . assert_called_once_with ( <EOL> url_for ( ) , <EOL> headers = { '<STR_LIT>' : '<STR_LIT>' } <EOL> ) <EOL> def test_reopen ( self ) : <EOL> """<STR_LIT>""" <EOL> self . instance . reopen ( ) <EOL> self . patch_called_with ( <EOL> url_for ( ) , <EOL> data = { <EOL> '<STR_LIT:title>' : self . instance . title , <EOL> '<STR_LIT:body>' : self . instance . body , <EOL> '<STR_LIT:state>' : '<STR_LIT>' <EOL> } <EOL> ) <EOL> def test_update ( self ) : <EOL> """<STR_LIT>""" <EOL> self . instance . update ( '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> self . patch_called_with ( <EOL> url_for ( ) , <EOL> data = { <EOL> '<STR_LIT:title>' : '<STR_LIT>' , <EOL> '<STR_LIT:body>' : '<STR_LIT>' , <EOL> '<STR_LIT:state>' : '<STR_LIT>' <EOL> } <EOL> ) <EOL> class TestPullRequestRequiresAuthentication ( <EOL> helper . UnitRequiresAuthenticationHelper ) : <EOL> """<STR_LIT>""" <EOL> described_class = pulls . PullRequest <EOL> example_data = get_pr_example_data ( ) <EOL> def test_close ( self ) : <EOL> """<STR_LIT>""" <EOL> with pytest . raises ( GitHubError ) : <EOL> self . instance . close ( ) <EOL> def test_create_review_comment ( self ) : <EOL> """<STR_LIT>""" <EOL> with pytest . raises ( GitHubError ) : <EOL> self . instance . create_review_comment ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT:1> ) <EOL> def test_merge ( self ) : <EOL> """<STR_LIT>""" <EOL> with pytest . raises ( GitHubError ) : <EOL> self . instance . merge ( ) <EOL> def test_reopen ( self ) : <EOL> """<STR_LIT>""" <EOL> with pytest . raises ( GitHubError ) : <EOL> self . instance . reopen ( ) <EOL> def test_update ( self ) : <EOL> """<STR_LIT>""" <EOL> with pytest . raises ( GitHubError ) : <EOL> self . instance . update ( '<STR_LIT:foo>' , '<STR_LIT:bar>' , '<STR_LIT>' ) <EOL> class TestPullRequestIterator ( helper . UnitIteratorHelper ) : <EOL> """<STR_LIT>""" <EOL> described_class = pulls . PullRequest <EOL> example_data = get_pr_example_data ( ) <EOL> def test_commits ( self ) : <EOL> """<STR_LIT>""" <EOL> i = self . instance . commits ( ) <EOL> self . get_next ( i ) <EOL> self . session . get . assert_called_once_with ( <EOL> url_for ( '<STR_LIT>' ) , <EOL> params = { '<STR_LIT>' : <NUM_LIT:100> } , <EOL> headers = { } <EOL> ) <EOL> def test_issue_comments ( self ) : <EOL> """<STR_LIT>""" <EOL> i = self . instance . issue_comments ( ) <EOL> self . get_next ( i ) <EOL> self . session . get . assert_called_once_with ( <EOL> url_for ( '<STR_LIT>' ) . replace ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> params = { '<STR_LIT>' : <NUM_LIT:100> } , <EOL> headers = { } <EOL> ) <EOL> def test_files ( self ) : <EOL> """<STR_LIT>""" <EOL> i = self . instance . files ( ) <EOL> self . get_next ( i ) <EOL> self . session . get . assert_called_once_with ( <EOL> url_for ( '<STR_LIT>' ) , <EOL> params = { '<STR_LIT>' : <NUM_LIT:100> } , <EOL> headers = { } <EOL> ) <EOL> def test_review_comments ( self ) : <EOL> """<STR_LIT>""" <EOL> i = self . instance . review_comments ( ) <EOL> self . get_next ( i ) <EOL> self . session . get . assert_called_once_with ( <EOL> url_for ( '<STR_LIT>' ) , <EOL> params = { '<STR_LIT>' : <NUM_LIT:100> } , <EOL> headers = { } <EOL> ) <EOL> class TestReviewComment ( helper . UnitHelper ) : <EOL> """<STR_LIT>""" <EOL> described_class = pulls . ReviewComment <EOL> get_comment_example_data = helper . create_example_data_helper ( <EOL> '<STR_LIT>' <EOL> ) <EOL> example_data = get_comment_example_data ( ) <EOL> def test_reply ( self ) : <EOL> """<STR_LIT>""" <EOL> self . instance . reply ( '<STR_LIT:foo>' ) <EOL> self . post_called_with ( <EOL> url_for ( '<STR_LIT>' ) , <EOL> data = { '<STR_LIT:body>' : '<STR_LIT:foo>' , '<STR_LIT>' : '<STR_LIT:1>' } <EOL> ) <EOL> def test_reply_requires_authentication ( self ) : <EOL> """<STR_LIT>""" <EOL> self . session . has_auth . return_value = False <EOL> with pytest . raises ( GitHubError ) : <EOL> self . instance . reply ( '<STR_LIT>' ) <EOL> class TestPullFile ( helper . UnitHelper ) : <EOL> """<STR_LIT>""" <EOL> described_class = pulls . PullFile <EOL> get_pull_file_example_data = helper . create_example_data_helper ( <EOL> '<STR_LIT>' <EOL> ) <EOL> example_data = get_pull_file_example_data ( ) <EOL> def test_contents ( self ) : <EOL> """<STR_LIT>""" <EOL> self . instance . contents ( ) <EOL> self . session . get . assert_called_once_with ( <EOL> self . example_data [ '<STR_LIT>' ] <EOL> ) </s>
