<s> from agithub . GitHub import GitHub <EOL> from agithub . base import IncompleteRequest <EOL> import mock <EOL> import unittest <EOL> class TestGitHubObjectCreation ( unittest . TestCase ) : <EOL> def test_user_pw ( self ) : <EOL> gh = GitHub ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertTrue ( gh is not None ) <EOL> gh = GitHub ( username = '<STR_LIT>' , password = '<STR_LIT>' ) <EOL> self . assertTrue ( gh is not None ) <EOL> def test_token ( self ) : <EOL> gh = GitHub ( username = '<STR_LIT>' , token = '<STR_LIT>' ) <EOL> self . assertTrue ( gh is not None ) <EOL> gh = GitHub ( token = '<STR_LIT>' ) <EOL> self . assertTrue ( gh is not None ) <EOL> def test_token_password ( self ) : <EOL> with self . assertRaises ( TypeError ) : <EOL> gh = GitHub ( <EOL> username = '<STR_LIT>' , password = '<STR_LIT>' , token = '<STR_LIT>' ) <EOL> class TestIncompleteRequest ( unittest . TestCase ) : <EOL> def newIncompleteRequest ( self ) : <EOL> return IncompleteRequest ( mock . Client ( ) ) <EOL> def test_pathByGetAttr ( self ) : <EOL> rb = self . newIncompleteRequest ( ) <EOL> rb . hug . an . octocat <EOL> self . assertEqual ( rb . url , "<STR_LIT>" ) <EOL> def test_callMethodDemo ( self ) : <EOL> rb = self . newIncompleteRequest ( ) <EOL> self . assertEqual ( rb . path . demo ( ) , <EOL> { "<STR_LIT>" : "<STR_LIT>" <EOL> , "<STR_LIT:args>" : ( ) <EOL> , "<STR_LIT>" : { "<STR_LIT:url>" : "<STR_LIT>" } <EOL> } ) <EOL> def test_pathByGetItem ( self ) : <EOL> rb = self . newIncompleteRequest ( ) <EOL> rb [ "<STR_LIT>" ] [ <NUM_LIT:1> ] [ "<STR_LIT>" ] <EOL> self . assertEqual ( rb . url , "<STR_LIT>" ) <EOL> def test_callMethodDemo ( self ) : <EOL> rb = self . newIncompleteRequest ( ) <EOL> self . assertEqual ( rb . path . demo ( ) , <EOL> { "<STR_LIT>" : "<STR_LIT>" <EOL> , "<STR_LIT:args>" : ( ) <EOL> , "<STR_LIT>" : { "<STR_LIT:url>" : "<STR_LIT>" } <EOL> } ) <EOL> def test_callMethodTest ( self ) : <EOL> rb = self . newIncompleteRequest ( ) <EOL> self . assertEqual ( rb . path . test ( ) , <EOL> { "<STR_LIT>" : "<STR_LIT:test>" <EOL> , "<STR_LIT:args>" : ( ) <EOL> , "<STR_LIT>" : { "<STR_LIT:url>" : "<STR_LIT>" } <EOL> } ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
