<s> from unittest . mock import Mock , call <EOL> from gitman import common <EOL> from gitman . common import _Config <EOL> class TestShowConsole : <EOL> def setup_method ( self , _ ) : <EOL> _Config . indent_level = <NUM_LIT:0> <EOL> _Config . verbosity = <NUM_LIT:0> <EOL> self . file = Mock ( ) <EOL> def test_show ( self ) : <EOL> common . show ( "<STR_LIT>" , file = self . file ) <EOL> assert [ <EOL> call . write ( "<STR_LIT>" ) , <EOL> call . write ( "<STR_LIT:\n>" ) , <EOL> ] == self . file . mock_calls <EOL> def test_show_after_indent ( self ) : <EOL> common . indent ( ) <EOL> common . show ( "<STR_LIT>" , file = self . file ) <EOL> assert [ <EOL> call . write ( "<STR_LIT>" ) , <EOL> call . write ( "<STR_LIT:\n>" ) , <EOL> ] == self . file . mock_calls <EOL> def test_show_after_1_indent_2_dedent ( self ) : <EOL> common . indent ( ) <EOL> common . dedent ( ) <EOL> common . dedent ( ) <EOL> common . show ( "<STR_LIT>" , file = self . file ) <EOL> assert [ <EOL> call . write ( "<STR_LIT>" ) , <EOL> call . write ( "<STR_LIT:\n>" ) , <EOL> ] == self . file . mock_calls <EOL> class TestShowLog : <EOL> def setup_method ( self , _ ) : <EOL> _Config . indent_level = <NUM_LIT:0> <EOL> _Config . verbosity = <NUM_LIT:1> <EOL> self . log = Mock ( ) <EOL> def test_show ( self ) : <EOL> common . show ( "<STR_LIT>" , log = self . log ) <EOL> assert [ <EOL> call . info ( "<STR_LIT>" ) , <EOL> ] == self . log . mock_calls <EOL> def test_show_after_indent ( self ) : <EOL> common . indent ( ) <EOL> common . show ( "<STR_LIT>" , log = self . log ) <EOL> assert [ <EOL> call . info ( "<STR_LIT:|>" ) , <EOL> ] == self . log . mock_calls <EOL> def test_show_after_1_indent_2_dedent ( self ) : <EOL> common . indent ( ) <EOL> common . dedent ( ) <EOL> common . dedent ( ) <EOL> common . show ( "<STR_LIT>" , log = self . log ) <EOL> assert [ <EOL> call . info ( "<STR_LIT:|>" ) , <EOL> ] == self . log . mock_calls <EOL> class TestShowQuiet : <EOL> def setup_method ( self , _ ) : <EOL> _Config . indent_level = <NUM_LIT:0> <EOL> _Config . verbosity = - <NUM_LIT:1> <EOL> self . file = Mock ( ) <EOL> self . log = Mock ( ) <EOL> def test_show ( self ) : <EOL> common . show ( "<STR_LIT>" , file = self . file , log = self . log ) <EOL> assert [ ] == self . file . mock_calls <EOL> assert [ ] == self . log . mock_calls </s>
