<s> from __future__ import unicode_literals <EOL> from . import CommandTestCase , override_settings <EOL> @ override_settings ( ) <EOL> class AliasCommandTestCase ( CommandTestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super ( AliasCommandTestCase , self ) . setUp ( ) <EOL> self . _settings [ '<STR_LIT>' ] = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:foo>' : '<STR_LIT>' <EOL> } <EOL> def run_alias_command ( self , args ) : <EOL> return self . run_command ( '<STR_LIT>' , args ) <EOL> def test_alias_list ( self ) : <EOL> output = self . run_alias_command ( [ ] ) <EOL> lines = output . splitlines ( ) <EOL> self . assertEquals ( len ( lines ) , <NUM_LIT:3> ) <EOL> self . assertIn ( "<STR_LIT>" , lines ) <EOL> self . assertIn ( "<STR_LIT>" , lines ) <EOL> self . assertIn ( "<STR_LIT>" , lines ) <EOL> def test_alias_search_mapping_exact ( self ) : <EOL> output = self . run_alias_command ( [ '<STR_LIT:list>' , '<STR_LIT>' ] ) <EOL> self . assertEquals ( output , "<STR_LIT>" ) <EOL> def test_alias_search_mapping_partial ( self ) : <EOL> output = self . run_alias_command ( [ '<STR_LIT:list>' , '<STR_LIT>' ] ) <EOL> lines = output . splitlines ( ) <EOL> self . assertEquals ( len ( lines ) , <NUM_LIT:2> ) <EOL> self . assertIn ( "<STR_LIT>" , lines ) <EOL> self . assertIn ( "<STR_LIT>" , lines ) <EOL> def test_alias_search_project ( self ) : <EOL> output = self . run_alias_command ( [ '<STR_LIT:list>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> lines = output . splitlines ( ) <EOL> self . assertEquals ( len ( lines ) , <NUM_LIT:2> ) <EOL> self . assertIn ( "<STR_LIT>" , lines ) <EOL> self . assertIn ( "<STR_LIT>" , lines ) <EOL> output = self . run_alias_command ( [ '<STR_LIT:list>' , '<STR_LIT>' ] ) <EOL> lines = output . splitlines ( ) <EOL> self . assertEquals ( len ( lines ) , <NUM_LIT:0> ) <EOL> def test_alias_search_project_activity ( self ) : <EOL> output = self . run_alias_command ( [ '<STR_LIT:list>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> lines = output . splitlines ( ) <EOL> self . assertEquals ( len ( lines ) , <NUM_LIT:1> ) <EOL> self . assertIn ( "<STR_LIT>" , lines ) <EOL> output = self . run_alias_command ( [ '<STR_LIT:list>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> lines = output . splitlines ( ) <EOL> self . assertEquals ( len ( lines ) , <NUM_LIT:0> ) <EOL> def test_alias_add ( self ) : <EOL> self . run_alias_command ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:test>' , '<STR_LIT:bar>' , '<STR_LIT>' ] ) <EOL> with open ( self . config_file , '<STR_LIT:r>' ) as f : <EOL> config_lines = f . readlines ( ) <EOL> self . assertIn ( '<STR_LIT>' , config_lines ) <EOL> @ override_settings ( { '<STR_LIT>' : { <EOL> '<STR_LIT>' : None <EOL> } } ) <EOL> def test_local_alias ( self ) : <EOL> stdout = self . run_alias_command ( [ ] ) <EOL> self . assertIn ( '<STR_LIT>' , stdout ) </s>
