<s> """<STR_LIT>""" <EOL> import github3 <EOL> from github3 import repos <EOL> from . helper import IntegrationHelper <EOL> class TestPullRequest ( IntegrationHelper ) : <EOL> """<STR_LIT>""" <EOL> def get_pull_request ( self , repository = '<STR_LIT>' , num = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> owner , repo = repository . split ( '<STR_LIT:/>' ) <EOL> p = self . gh . pull_request ( owner , repo , num ) <EOL> assert isinstance ( p , github3 . pulls . PullRequest ) <EOL> return p <EOL> def test_close ( self ) : <EOL> """<STR_LIT>""" <EOL> self . basic_login ( ) <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . get_pull_request ( num = <NUM_LIT> ) <EOL> assert p . close ( ) is True <EOL> def test_create_comment ( self ) : <EOL> """<STR_LIT>""" <EOL> self . basic_login ( ) <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . get_pull_request ( num = <NUM_LIT> ) <EOL> comment = p . create_comment ( '<STR_LIT>' ) <EOL> assert isinstance ( comment , github3 . issues . comment . IssueComment ) <EOL> def test_commits ( self ) : <EOL> """<STR_LIT>""" <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . get_pull_request ( ) <EOL> for commit in p . commits ( ) : <EOL> assert isinstance ( commit , github3 . repos . commit . RepoCommit ) <EOL> def test_create_review_comment ( self ) : <EOL> """<STR_LIT>""" <EOL> self . basic_login ( ) <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . get_pull_request ( num = <NUM_LIT> ) <EOL> comment = p . create_review_comment ( <EOL> body = '<STR_LIT>' , <EOL> commit_id = '<STR_LIT>' , <EOL> path = '<STR_LIT>' , <EOL> position = <NUM_LIT:6> <EOL> ) <EOL> assert isinstance ( comment , github3 . pulls . ReviewComment ) <EOL> def test_diff ( self ) : <EOL> """<STR_LIT>""" <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . get_pull_request ( ) <EOL> diff = p . diff ( ) <EOL> assert isinstance ( diff , bytes ) <EOL> assert len ( diff ) > <NUM_LIT:0> <EOL> def test_files ( self ) : <EOL> """<STR_LIT>""" <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . get_pull_request ( ) <EOL> for pr_file in p . files ( ) : <EOL> assert isinstance ( pr_file , github3 . pulls . PullFile ) <EOL> def test_is_merged ( self ) : <EOL> """<STR_LIT>""" <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . get_pull_request ( ) <EOL> assert p . is_merged ( ) is True <EOL> def test_issue ( self ) : <EOL> """<STR_LIT>""" <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . get_pull_request ( ) <EOL> issue = p . issue ( ) <EOL> assert isinstance ( issue , github3 . issues . Issue ) <EOL> def test_issue_comments ( self ) : <EOL> """<STR_LIT>""" <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . get_pull_request ( ) <EOL> for comment in p . issue_comments ( ) : <EOL> assert isinstance ( comment , <EOL> github3 . issues . comment . IssueComment ) <EOL> def test_patch ( self ) : <EOL> """<STR_LIT>""" <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . get_pull_request ( ) <EOL> patch = p . patch ( ) <EOL> assert isinstance ( patch , bytes ) <EOL> assert len ( patch ) > <NUM_LIT:0> <EOL> def test_reopen ( self ) : <EOL> """<STR_LIT>""" <EOL> self . basic_login ( ) <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . get_pull_request ( num = <NUM_LIT> ) <EOL> assert p . reopen ( ) is True <EOL> def test_review_comments ( self ) : <EOL> """<STR_LIT>""" <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . get_pull_request ( ) <EOL> for comment in p . review_comments ( ) : <EOL> assert isinstance ( comment , github3 . pulls . ReviewComment ) <EOL> def test_update ( self ) : <EOL> """<STR_LIT>""" <EOL> self . basic_login ( ) <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . get_pull_request ( num = <NUM_LIT> ) <EOL> assert p . update ( p . title ) is True <EOL> class TestReviewComment ( IntegrationHelper ) : <EOL> """<STR_LIT>""" <EOL> def test_reply ( self ) : <EOL> """<STR_LIT>""" <EOL> self . basic_login ( ) <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> p = self . gh . pull_request ( '<STR_LIT>' , '<STR_LIT>' , <NUM_LIT> ) <EOL> c = next ( p . review_comments ( ) ) <EOL> comment = c . reply ( '<STR_LIT>' ) <EOL> assert isinstance ( comment , github3 . pulls . ReviewComment ) <EOL> class TestPullFile ( IntegrationHelper ) : <EOL> """<STR_LIT>""" <EOL> def get_pull_request_file ( self , owner , repo , pull_number , filename ) : <EOL> p = self . gh . pull_request ( owner , repo , pull_number ) <EOL> for pull_file in p . files ( ) : <EOL> if pull_file . filename == filename : <EOL> break <EOL> else : <EOL> assert False , "<STR_LIT>" . format ( filename ) <EOL> return pull_file <EOL> def test_contents ( self ) : <EOL> """<STR_LIT>""" <EOL> cassette_name = self . cassette_name ( '<STR_LIT>' ) <EOL> with self . recorder . use_cassette ( cassette_name ) : <EOL> pull_file = self . get_pull_request_file ( <EOL> owner = '<STR_LIT>' , repo = '<STR_LIT>' , pull_number = <NUM_LIT> , <EOL> filename = '<STR_LIT>' <EOL> ) <EOL> contents = pull_file . contents ( ) <EOL> assert isinstance ( contents , repos . contents . Contents ) <EOL> assert contents . decoded != b'<STR_LIT>' </s>
