@ -220,7 +220,7 @@ class GclientTest(trial_dir.TestCase):
# auto-fixed.
d = gclient . Dependency (
None , ' name ' , ' proto://host/path/@revision ' , None , None , None , None ,
None , ' ' , True )
None , ' ' , True , False )
self . assertEquals ( ' proto://host/path@revision ' , d . url )
def testStr ( self ) :
@ -228,28 +228,28 @@ class GclientTest(trial_dir.TestCase):
options , _ = parser . parse_args ( [ ] )
obj = gclient . GClient ( ' foo ' , options )
obj . add_dependencies_and_close (
[
gclient . Dependency (
obj , ' foo ' , ' url ' , None , None , None , None , None , ' DEPS ' , Tru e) ,
gclient . Dependency (
obj , ' bar ' , ' url ' , None , None , None , None , None , ' DEPS ' , Tru e) ,
] ,
[ ] )
[
gclient . Dependency (
obj , ' foo ' , ' url ' , None , None , None , None , None , ' DEPS ' , Tru e, Fals e) ,
gclient . Dependency (
obj , ' bar ' , ' url ' , None , None , None , None , None , ' DEPS ' , Tru e, Fals e) ,
] ,
[ ] )
obj . dependencies [ 0 ] . add_dependencies_and_close (
[
gclient . Dependency (
obj . dependencies [ 0 ] , ' foo/dir1 ' , ' url ' , None , None , None , None ,
None , ' DEPS ' , Tru e) ,
gclient . Dependency (
obj . dependencies [ 0 ] , ' foo/dir2 ' ,
gclient . GClientKeywords . FromImpl ( ' bar ' ) , None , None , None , None ,
None , ' DEPS ' , Tru e) ,
gclient . Dependency (
obj . dependencies [ 0 ] , ' foo/dir3 ' ,
gclient . GClientKeywords . FileImpl ( ' url ' ) , None , None , None , None ,
None , ' DEPS ' , Tru e) ,
] ,
[ ] )
[
gclient . Dependency (
obj . dependencies [ 0 ] , ' foo/dir1 ' , ' url ' , None , None , None , None ,
None , ' DEPS ' , Tru e, Fals e) ,
gclient . Dependency (
obj . dependencies [ 0 ] , ' foo/dir2 ' ,
gclient . GClientKeywords . FromImpl ( ' bar ' ) , None , None , None , None ,
None , ' DEPS ' , Tru e, Fals e) ,
gclient . Dependency (
obj . dependencies [ 0 ] , ' foo/dir3 ' ,
gclient . GClientKeywords . FileImpl ( ' url ' ) , None , None , None , None ,
None , ' DEPS ' , Tru e, Fals e) ,
] ,
[ ] )
# Make sure __str__() works fine.
# pylint: disable=W0212
obj . dependencies [ 0 ] . _file_list . append ( ' foo ' )
@ -567,7 +567,7 @@ class GclientTest(trial_dir.TestCase):
""" Verifies expected behavior of LateOverride. """
url = " git@github.com:dart-lang/spark.git "
d = gclient . Dependency ( None , ' name ' , ' url ' ,
None , None , None , None , None , ' ' , True )
None , None , None , None , None , ' ' , True , False )
late_url = d . LateOverride ( url )
self . assertEquals ( url , late_url )
@ -739,7 +739,44 @@ class GclientTest(trial_dir.TestCase):
' } \n '
' recursedeps = [ " bar " ] ' )
write (
os . path . join ( ' bar ' , ' DEPS ' ) ,
os . path . join ( ' foo/bar ' , ' DEPS ' ) ,
' deps = { \n '
' " baz " : " /baz " , \n '
' } ' )
write (
os . path . join ( ' baz ' , ' DEPS ' ) ,
' deps = { \n '
' " fizz " : " /fizz " , \n '
' } ' )
options , _ = gclient . OptionParser ( ) . parse_args ( [ ] )
obj = gclient . GClient . LoadCurrentConfig ( options )
obj . RunOnDeps ( ' None ' , [ ] )
self . assertEquals (
[
( ' foo ' , ' svn://example.com/foo ' ) ,
( ' foo/bar ' , ' svn://example.com/foo/bar ' ) ,
( ' foo/baz ' , ' svn://example.com/foo/bar/baz ' ) ,
] ,
self . _get_processed ( ) )
def testRelativeRecursion ( self ) :
""" Verifies that nested use_relative_paths is always respected. """
write (
' .gclient ' ,
' solutions = [ \n '
' { " name " : " foo " , " url " : " svn://example.com/foo " }, \n '
' ] ' )
write (
os . path . join ( ' foo ' , ' DEPS ' ) ,
' use_relative_paths = True \n '
' deps = { \n '
' " bar " : " /bar " , \n '
' } \n '
' recursedeps = [ " bar " ] ' )
write (
os . path . join ( ' foo/bar ' , ' DEPS ' ) ,
' use_relative_paths = True \n '
' deps = { \n '
' " baz " : " /baz " , \n '
' } ' )
@ -756,9 +793,7 @@ class GclientTest(trial_dir.TestCase):
[
( ' foo ' , ' svn://example.com/foo ' ) ,
( ' foo/bar ' , ' svn://example.com/foo/bar ' ) ,
# TODO(agable): Figure out why baz isn't included here. The
# recursedeps = ["bar"] in foo's DEPS means that we should be
# fetching the entries in bar's DEPS file, which includes baz.
( ' foo/bar/baz ' , ' svn://example.com/foo/bar/baz ' ) ,
] ,
self . _get_processed ( ) )