<s> """<STR_LIT>""" <EOL> import datetime <EOL> from openstackclient . common import timing <EOL> from openstackclient . tests import fakes <EOL> from openstackclient . tests import utils <EOL> timing_url = '<STR_LIT>' <EOL> timing_elapsed = <NUM_LIT> <EOL> class FakeGenericClient ( object ) : <EOL> def __init__ ( self , ** kwargs ) : <EOL> self . auth_token = kwargs [ '<STR_LIT>' ] <EOL> self . management_url = kwargs [ '<STR_LIT>' ] <EOL> class TestTiming ( utils . TestCommand ) : <EOL> columns = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> def setUp ( self ) : <EOL> super ( TestTiming , self ) . setUp ( ) <EOL> self . app . timing_data = [ ] <EOL> self . app . client_manager . compute = FakeGenericClient ( <EOL> endpoint = fakes . AUTH_URL , <EOL> token = fakes . AUTH_TOKEN , <EOL> ) <EOL> self . app . client_manager . volume = FakeGenericClient ( <EOL> endpoint = fakes . AUTH_URL , <EOL> token = fakes . AUTH_TOKEN , <EOL> ) <EOL> self . cmd = timing . Timing ( self . app , None ) <EOL> def test_timing_list_no_data ( self ) : <EOL> arglist = [ ] <EOL> verifylist = [ ] <EOL> parsed_args = self . check_parser ( self . cmd , arglist , verifylist ) <EOL> columns , data = self . cmd . take_action ( parsed_args ) <EOL> self . assertEqual ( self . columns , columns ) <EOL> datalist = [ <EOL> ( '<STR_LIT>' , <NUM_LIT:0.0> , ) <EOL> ] <EOL> self . assertEqual ( datalist , data ) <EOL> def test_timing_list ( self ) : <EOL> self . app . timing_data = [ ( <EOL> timing_url , <EOL> datetime . timedelta ( microseconds = timing_elapsed * <NUM_LIT> ) , <EOL> ) ] <EOL> arglist = [ ] <EOL> verifylist = [ ] <EOL> parsed_args = self . check_parser ( self . cmd , arglist , verifylist ) <EOL> columns , data = self . cmd . take_action ( parsed_args ) <EOL> self . assertEqual ( self . columns , columns ) <EOL> datalist = [ <EOL> ( timing_url , timing_elapsed ) , <EOL> ( '<STR_LIT>' , timing_elapsed ) , <EOL> ] <EOL> self . assertEqual ( datalist , data ) </s>
