#NEWLINE# def test_latest_not_found( monkeypatch , tmpdir ) : #NEWLINE# #INDENT# response = MagicMock ( ) #NEWLINE# response . raise_for_status . side_effect = Exception ( 'FAIL' ) #NEWLINE# runner = CliRunner ( ) #NEWLINE# monkeypatch . setattr ( 'stups_cli.config.load_config' , ( lambda x : { #NEWLINE# #INDENT# 'url' : 'https://pierone.example.org' , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# monkeypatch . setattr ( 'zign.api.get_token' , MagicMock ( return_value = 'tok123' ) ) #NEWLINE# monkeypatch . setattr ( 'pierone.api.get_existing_token' , MagicMock ( return_value = { #NEWLINE# #INDENT# 'access_token' : 'tok123' , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# monkeypatch . setattr ( 'pierone.api.session.get' , MagicMock ( return_value = tmpdir ) ) #NEWLINE# with runner . isolated_filesystem ( ) : #NEWLINE# #INDENT# result = runner . invoke ( cli , [ 'latest' , 'myteam' , 'myart' ] , catch_exceptions = False ) #NEWLINE# assert ( 'None' == result . output . rstrip ( ) )