#NEWLINE# def test_retrievePromotedVersionsContainsValidVersions( self ) : #NEWLINE# #INDENT# requests . packages . urllib3 . disable_warnings ( ) #NEWLINE# fileContents = '[{"name": "2.0.1.153", "published_at": "2015-04-24T15:24:29Z"},{"name": "1.0.0.15", "published_at": "2015-03-19T23:19:08Z"}]' #NEWLINE# config = { #NEWLINE# #INDENT# 'Authorization' : 'token 5dbf862c5197414138e70c4f3fb458c5f5a58f05' , #NEWLINE# 'Provider' : 'GitHubReleases' , #NEWLINE# 'Url' : 'https://api.github.com/repos/cimpress-mcp/PostalCodes.Net/releases' , #NEWLINE# #UNINDENT# } #NEWLINE# artifacter = GitHubReleases . GitHubReleases ( config ) #NEWLINE# with requests_mock . mock ( ) as m : #NEWLINE# #INDENT# m . get ( 'https://api.github.com/repos/cimpress-mcp/PostalCodes.Net/releases' , text = fileContents ) #NEWLINE# promotedVersion = artifacter . retrievePromotedVersions ( ) #NEWLINE# self . assertIn ( '1.0.0.15' , promotedVersion ) #NEWLINE# self . assertIn ( '2.0.1.153' , promotedVersion ) #NEWLINE# self . assertTrue ( 2 , len ( config ) ) #NEWLINE# #UNINDENT# sys . stdout = self . __stdoutSaved #NEWLINE# self . assertEquals ( 'GitHub Releases: Retrieving promoted from GitHubReleases at https://api.github.com/repos/cimpress-mcp/PostalCodes.Net/releases ...\nGitHub Releases: Found 2 promoted versions\n' , self . __out . getvalue ( ) )