<s> import unittest <EOL> from . . clients . readme_client import ReadmeClient <EOL> from . . clients . github_client import GitHubClient <EOL> from . . clients . bitbucket_client import BitBucketClient <EOL> from . . http_cache import HttpCache <EOL> from . import LAST_COMMIT_TIMESTAMP , LAST_COMMIT_VERSION , CLIENT_ID , CLIENT_SECRET <EOL> class GitHubClientTests ( unittest . TestCase ) : <EOL> maxDiff = None <EOL> def github_settings ( self ) : <EOL> return { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : HttpCache ( <NUM_LIT> ) , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : CLIENT_ID , <EOL> '<STR_LIT>' : CLIENT_SECRET <EOL> } <EOL> } <EOL> } <EOL> def test_github_client_repo_info ( self ) : <EOL> client = GitHubClient ( self . github_settings ( ) ) <EOL> self . assertEqual ( <EOL> { <EOL> '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT:description>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> client . repo_info ( '<STR_LIT>' ) <EOL> ) <EOL> def test_github_client_user_info ( self ) : <EOL> client = GitHubClient ( self . github_settings ( ) ) <EOL> self . assertEqual ( <EOL> [ { <EOL> '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT:description>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } ] , <EOL> client . user_info ( '<STR_LIT>' ) <EOL> ) <EOL> def test_github_readme ( self ) : <EOL> client = ReadmeClient ( self . github_settings ( ) ) <EOL> self . assertEqual ( <EOL> { <EOL> '<STR_LIT:filename>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> client . readme_info ( '<STR_LIT>' ) <EOL> ) <EOL> def test_github_client_branch_downloads ( self ) : <EOL> client = GitHubClient ( self . github_settings ( ) ) <EOL> self . assertEqual ( <EOL> [ <EOL> { <EOL> '<STR_LIT:date>' : LAST_COMMIT_TIMESTAMP , <EOL> '<STR_LIT:version>' : LAST_COMMIT_VERSION , <EOL> '<STR_LIT:url>' : '<STR_LIT>' <EOL> } <EOL> ] , <EOL> client . download_info ( '<STR_LIT>' ) <EOL> ) <EOL> def test_github_client_tags_downloads ( self ) : <EOL> client = GitHubClient ( self . github_settings ( ) ) <EOL> self . assertEqual ( <EOL> [ <EOL> { <EOL> '<STR_LIT:date>' : '<STR_LIT>' , <EOL> '<STR_LIT:version>' : '<STR_LIT>' , <EOL> '<STR_LIT:url>' : '<STR_LIT>' <EOL> } , <EOL> { <EOL> '<STR_LIT:date>' : '<STR_LIT>' , <EOL> '<STR_LIT:version>' : '<STR_LIT>' , <EOL> '<STR_LIT:url>' : '<STR_LIT>' <EOL> } , <EOL> { <EOL> '<STR_LIT:date>' : '<STR_LIT>' , <EOL> '<STR_LIT:version>' : '<STR_LIT>' , <EOL> '<STR_LIT:url>' : '<STR_LIT>' <EOL> } , <EOL> { <EOL> '<STR_LIT:date>' : '<STR_LIT>' , <EOL> '<STR_LIT:version>' : '<STR_LIT>' , <EOL> '<STR_LIT:url>' : '<STR_LIT>' <EOL> } <EOL> ] , <EOL> client . download_info ( '<STR_LIT>' ) <EOL> ) <EOL> def test_github_client_tags_prefix_downloads ( self ) : <EOL> client = GitHubClient ( self . github_settings ( ) ) <EOL> self . assertEqual ( <EOL> [ <EOL> { <EOL> '<STR_LIT:date>' : '<STR_LIT>' , <EOL> '<STR_LIT:version>' : '<STR_LIT>' , <EOL> '<STR_LIT:url>' : '<STR_LIT>' <EOL> } <EOL> ] , <EOL> client . download_info ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> ) <EOL> class BitBucketClientTests ( unittest . TestCase ) : <EOL> maxDiff = None <EOL> def bitbucket_settings ( self ) : <EOL> return { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : HttpCache ( <NUM_LIT> ) <EOL> } <EOL> def test_bitbucket_client_repo_info ( self ) : <EOL> client = BitBucketClient ( self . bitbucket_settings ( ) ) <EOL> self . assertEqual ( <EOL> { <EOL> '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT:description>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> client . repo_info ( '<STR_LIT>' ) <EOL> ) <EOL> def test_bitbucket_readme ( self ) : <EOL> client = ReadmeClient ( self . bitbucket_settings ( ) ) <EOL> self . assertEqual ( <EOL> { <EOL> '<STR_LIT:filename>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> client . readme_info ( '<STR_LIT>' ) <EOL> ) <EOL> def test_bitbucket_client_branch_downloads ( self ) : <EOL> client = BitBucketClient ( self . bitbucket_settings ( ) ) <EOL> self . assertEqual ( <EOL> [ <EOL> { <EOL> '<STR_LIT:date>' : LAST_COMMIT_TIMESTAMP , <EOL> '<STR_LIT:version>' : LAST_COMMIT_VERSION , <EOL> '<STR_LIT:url>' : '<STR_LIT>' <EOL> } <EOL> ] , <EOL> client . download_info ( '<STR_LIT>' ) <EOL> ) <EOL> def test_bitbucket_client_tags_downloads ( self ) : <EOL> client = BitBucketClient ( self . bitbucket_settings ( ) ) <EOL> self . assertEqual ( <EOL> [ <EOL> { <EOL> '<STR_LIT:date>' : '<STR_LIT>' , <EOL> '<STR_LIT:version>' : '<STR_LIT>' , <EOL> '<STR_LIT:url>' : '<STR_LIT>' <EOL> } , <EOL> { <EOL> '<STR_LIT:date>' : '<STR_LIT>' , <EOL> '<STR_LIT:version>' : '<STR_LIT>' , <EOL> '<STR_LIT:url>' : '<STR_LIT>' <EOL> } , <EOL> { <EOL> '<STR_LIT:date>' : '<STR_LIT>' , <EOL> '<STR_LIT:version>' : '<STR_LIT>' , <EOL> '<STR_LIT:url>' : '<STR_LIT>' <EOL> } , <EOL> { <EOL> '<STR_LIT:date>' : '<STR_LIT>' , <EOL> '<STR_LIT:version>' : '<STR_LIT>' , <EOL> '<STR_LIT:url>' : '<STR_LIT>' <EOL> } <EOL> ] , <EOL> client . download_info ( '<STR_LIT>' ) <EOL> ) <EOL> def test_bitbucket_client_tags_prefix_downloads ( self ) : <EOL> client = BitBucketClient ( self . bitbucket_settings ( ) ) <EOL> self . assertEqual ( <EOL> [ <EOL> { <EOL> '<STR_LIT:date>' : '<STR_LIT>' , <EOL> '<STR_LIT:version>' : '<STR_LIT>' , <EOL> '<STR_LIT:url>' : '<STR_LIT>' <EOL> } <EOL> ] , <EOL> client . download_info ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> ) </s>
