@ -48,40 +48,40 @@ class TestUtilityFunctions(unittest.TestCase):
def test_handle_args_valid_usage ( self ) :
def test_handle_args_valid_usage ( self ) :
response = fetch . handle_args ( [ ' filename ' , ' foo ' ] )
response = fetch . handle_args ( [ ' filename ' , ' foo ' ] )
self . assertEqual ( argparse . Namespace (
self . assertEqual (
dry_run = False ,
argparse . Namespace ( dry_run = False ,
nohooks = False ,
nohooks = False ,
no _ history= False ,
no history= False ,
force = False ,
force = False ,
config = ' foo ' ,
config = ' foo ' ,
protocol_override = None ,
protocol_override = None ,
props = [ ] ) , response )
props = [ ] ) , response )
response = fetch . handle_args ( [
response = fetch . handle_args ( [
' filename ' , ' -n ' , ' --dry-run ' , ' --nohooks ' , ' --no-history ' , ' --force ' ,
' filename ' , ' -n ' , ' --dry-run ' , ' --nohooks ' , ' --no-history ' , ' --force ' ,
' --protocol-override ' , ' sso ' , ' foo ' , ' --some-param=1 ' , ' --bar=2 '
' --protocol-override ' , ' sso ' , ' foo ' , ' --some-param=1 ' , ' --bar=2 '
] )
] )
self . assertEqual ( argparse . Namespace (
self . assertEqual (
dry_run = True ,
argparse . Namespace ( dry_run = True ,
nohooks = True ,
nohooks = True ,
no _ history= True ,
no history= True ,
force = True ,
force = True ,
config = ' foo ' ,
config = ' foo ' ,
protocol_override = ' sso ' ,
protocol_override = ' sso ' ,
props = [ ' --some-param=1 ' , ' --bar=2 ' ] ) , response )
props = [ ' --some-param=1 ' , ' --bar=2 ' ] ) , response )
response = fetch . handle_args ( [
response = fetch . handle_args ( [
' filename ' , ' -n ' , ' --dry-run ' , ' --no hooks' , ' --no - history' , ' --force ' ,
' filename ' , ' -n ' , ' --dry-run ' , ' --no - hooks' , ' --no history' , ' --force ' ,
' -p ' , ' sso ' , ' foo ' , ' --some-param=1 ' , ' --bar=2 '
' -p ' , ' sso ' , ' foo ' , ' --some-param=1 ' , ' --bar=2 '
] )
] )
self . assertEqual ( argparse . Namespace (
self . assertEqual (
dry_run = True ,
argparse . Namespace ( dry_run = True ,
nohooks = True ,
nohooks = True ,
no _ history= True ,
no history= True ,
force = True ,
force = True ,
config = ' foo ' ,
config = ' foo ' ,
protocol_override = ' sso ' ,
protocol_override = ' sso ' ,
props = [ ' --some-param=1 ' , ' --bar=2 ' ] ) , response )
props = [ ' --some-param=1 ' , ' --bar=2 ' ] ) , response )
@mock.patch ( ' os.path.exists ' , return_value = False )
@mock.patch ( ' os.path.exists ' , return_value = False )
@mock.patch ( ' sys.stdout ' , StringIO ( ) )
@mock.patch ( ' sys.stdout ' , StringIO ( ) )
@ -237,8 +237,7 @@ class TestGclientGitCheckout(unittest.TestCase):
self . run_gclient = mock . patch ( ' fetch.GclientCheckout.run_gclient ' ) . start ( )
self . run_gclient = mock . patch ( ' fetch.GclientCheckout.run_gclient ' ) . start ( )
self . run_git = mock . patch ( ' fetch.GitCheckout.run_git ' ) . start ( )
self . run_git = mock . patch ( ' fetch.GitCheckout.run_git ' ) . start ( )
self . opts = argparse . Namespace (
self . opts = argparse . Namespace ( dry_run = False , nohooks = True , nohistory = False )
dry_run = False , nohooks = True , no_history = False )
specs = {
specs = {
' solutions ' : [ {
' solutions ' : [ {
' foo ' : ' bar ' ,
' foo ' : ' bar ' ,