<s> import os <EOL> import sys <EOL> import unittest <EOL> import_path = os . path . join ( os . path . dirname ( os . path . realpath ( __file__ ) ) , '<STR_LIT>' ) <EOL> sys . path . append ( import_path ) <EOL> from command import CommandContext , ListCommand <EOL> import_path = os . path . join ( os . path . dirname ( os . path . realpath ( __file__ ) ) , '<STR_LIT>' ) <EOL> sys . path . append ( import_path ) <EOL> from alter_util import AlterUtil <EOL> from env_util import EnvironmentUtil <EOL> from test_util import make_argv <EOL> class ListTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> EnvironmentUtil . setup_fresh_test_env ( ) <EOL> self . context = CommandContext . via ( { <EOL> '<STR_LIT:type>' : '<STR_LIT>' } ) <EOL> self . listCommand = ListCommand ( self . context ) <EOL> def tearDown ( self ) : <EOL> EnvironmentUtil . teardown_fresh_test_env ( ) <EOL> def test_order ( self ) : <EOL> id1 , id2 = AlterUtil . create_alters ( [ <NUM_LIT:1> , <NUM_LIT:2> ] ) <EOL> AlterUtil . run_alters ( ) <EOL> sys . argv = make_argv ( [ ] ) <EOL> result = self . listCommand . run ( ) <EOL> self . assertEqual ( [ id1 , id2 ] , result ) <EOL> def test_order_reverse ( self ) : <EOL> id1 , id2 = AlterUtil . create_alters ( [ <NUM_LIT:1> , <NUM_LIT:2> ] ) <EOL> AlterUtil . run_alters ( ) <EOL> sys . argv = make_argv ( [ '<STR_LIT>' ] ) <EOL> result = self . listCommand . run ( ) <EOL> self . assertEqual ( [ id2 , id1 ] , result ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
