Commit ab27b8ed authored by msb@chromium.org's avatar msb@chromium.org

gclient: fix unittests

Review URL: http://codereview.chromium.org/254012

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@27492 0039d316-1c4b-4281-b951-d872f2087c98
parent 8301701a
...@@ -394,10 +394,9 @@ class GClientClassTestCase(GclientTestCase): ...@@ -394,10 +394,9 @@ class GClientClassTestCase(GclientTestCase):
) % (solution_name, self.url) ) % (solution_name, self.url)
entries_content = ( entries_content = (
'entries = [\n' "entries = \\\n"
' "%s",\n' "{ '%s': '%s'}\n"
']\n' ) % (solution_name, self.url)
) % solution_name
options = self.Options() options = self.Options()
...@@ -445,11 +444,10 @@ class GClientClassTestCase(GclientTestCase): ...@@ -445,11 +444,10 @@ class GClientClassTestCase(GclientTestCase):
"}\n") "}\n")
entries_content = ( entries_content = (
'entries = [\n' "entries = \\\n"
' "%s",\n' "{ '%s': '%s',\n"
' "%s",\n' " '%s': 'svn://scm.t/trunk'}\n"
']\n' ) % (solution_name, self.url, os.path.join(solution_name, 'src', 't'))
) % (os.path.join(solution_name, 'src', 't'), solution_name)
scm_wrapper_sol = self.mox.CreateMockAnything() scm_wrapper_sol = self.mox.CreateMockAnything()
scm_wrapper_t = self.mox.CreateMockAnything() scm_wrapper_t = self.mox.CreateMockAnything()
...@@ -515,12 +513,11 @@ class GClientClassTestCase(GclientTestCase): ...@@ -515,12 +513,11 @@ class GClientClassTestCase(GclientTestCase):
) )
entries_content = ( entries_content = (
'entries = [\n' "entries = \\\n"
' "%s",\n' "{ 'src/n': 'svn://custom.n/trunk',\n"
' "src/n",\n' " 'src/t': 'svn://custom.t/trunk',\n"
' "src/t",\n' " '%s': '%s'}\n"
']\n' ) % (solution_name, self.url)
) % solution_name
scm_wrapper_sol = self.mox.CreateMockAnything() scm_wrapper_sol = self.mox.CreateMockAnything()
scm_wrapper_t = self.mox.CreateMockAnything() scm_wrapper_t = self.mox.CreateMockAnything()
...@@ -603,10 +600,11 @@ class GClientClassTestCase(GclientTestCase): ...@@ -603,10 +600,11 @@ class GClientClassTestCase(GclientTestCase):
"}\n") "}\n")
entries_content = ( entries_content = (
'entries = [\n "%s",\n' "entries = \\\n"
' "%s",\n' "{ 'src/t': 'http://svn.t/trunk',\n"
' "src/t",\n' " '%s': '%s',\n"
']\n') % (name_a, name_b) " '%s': '%s'}\n"
) % (name_a, url_a, name_b, url_b)
scm_wrapper_a = self.mox.CreateMockAnything() scm_wrapper_a = self.mox.CreateMockAnything()
scm_wrapper_b = self.mox.CreateMockAnything() scm_wrapper_b = self.mox.CreateMockAnything()
...@@ -667,6 +665,11 @@ class GClientClassTestCase(GclientTestCase): ...@@ -667,6 +665,11 @@ class GClientClassTestCase(GclientTestCase):
'custom_deps': {}, 'custom_deps': {},
}, ]""" % (name, self.url) }, ]""" % (name, self.url)
entries_content = (
"entries = \\\n"
"{ '%s': '%s'}\n"
) % (name, self.url)
options = self.Options() options = self.Options()
gclient.os.path.exists(os.path.join(self.root_dir, name, '.git') gclient.os.path.exists(os.path.join(self.root_dir, name, '.git')
).AndReturn(False) ).AndReturn(False)
...@@ -678,7 +681,7 @@ class GClientClassTestCase(GclientTestCase): ...@@ -678,7 +681,7 @@ class GClientClassTestCase(GclientTestCase):
gclient.FileRead(os.path.join(self.root_dir, name, options.deps_file) gclient.FileRead(os.path.join(self.root_dir, name, options.deps_file)
).AndReturn("Boo = 'a'") ).AndReturn("Boo = 'a'")
gclient.FileWrite(os.path.join(self.root_dir, options.entries_filename), gclient.FileWrite(os.path.join(self.root_dir, options.entries_filename),
'entries = [\n "%s",\n]\n' % name) entries_content)
self.mox.ReplayAll() self.mox.ReplayAll()
client = self._gclient_gclient(self.root_dir, options) client = self._gclient_gclient(self.root_dir, options)
...@@ -721,16 +724,21 @@ deps_os = { ...@@ -721,16 +724,21 @@ deps_os = {
'src/third_party/python_24': 'svn://random_server:123/trunk/python_24@5580', 'src/third_party/python_24': 'svn://random_server:123/trunk/python_24@5580',
}, },
}""" }"""
entries_content = (
'entries = [\n "src",\n'
' "foo/third_party/WebKit",\n'
' "src/third_party/cygwin",\n'
' "src/third_party/python_24",\n'
' "src/breakpad/bar",\n'
']\n')
cygwin_path = 'dummy path cygwin' cygwin_path = 'dummy path cygwin'
webkit_path = 'dummy path webkit' webkit_path = 'dummy path webkit'
entries_content = (
"entries = \\\n"
"{ 'foo/third_party/WebKit': '%s',\n"
" 'src': '%s',\n"
" 'src/breakpad/bar':"
" 'http://google-breakpad.googlecode.com/svn/trunk/src@285',\n"
" 'src/third_party/cygwin': '%s',\n"
" 'src/third_party/python_24':"
" 'svn://random_server:123/trunk/python_24@5580'}\n"
) % (webkit_path, self.url, cygwin_path)
scm_wrapper_bleh = self.mox.CreateMockAnything() scm_wrapper_bleh = self.mox.CreateMockAnything()
scm_wrapper_src = self.mox.CreateMockAnything() scm_wrapper_src = self.mox.CreateMockAnything()
scm_wrapper_src2 = self.mox.CreateMockAnything() scm_wrapper_src2 = self.mox.CreateMockAnything()
...@@ -850,12 +858,15 @@ deps_os = { ...@@ -850,12 +858,15 @@ deps_os = {
deps = { deps = {
'foo/third_party/WebKit': Var('webkit') + 'WebKit', 'foo/third_party/WebKit': Var('webkit') + 'WebKit',
}""" }"""
entries_content = (
'entries = [\n "foo/third_party/WebKit",\n'
' "%s",\n'
']\n') % name
webkit_path = 'dummy path webkit' webkit_path = 'dummy path webkit'
entries_content = (
"entries = \\\n"
"{ 'foo/third_party/WebKit': '%s',\n"
" '%s': '%s'}\n"
) % (webkit_path, name, self.url)
scm_wrapper_webkit = self.mox.CreateMockAnything() scm_wrapper_webkit = self.mox.CreateMockAnything()
scm_wrapper_src = self.mox.CreateMockAnything() scm_wrapper_src = self.mox.CreateMockAnything()
...@@ -905,12 +916,15 @@ deps = { ...@@ -905,12 +916,15 @@ deps = {
deps = { deps = {
'foo/third_party/WebKit': Var('webkit') + 'WebKit', 'foo/third_party/WebKit': Var('webkit') + 'WebKit',
}""" }"""
entries_content = (
'entries = [\n "foo/third_party/WebKit",\n'
' "%s",\n'
']\n') % name
webkit_path = 'dummy path webkit' webkit_path = 'dummy path webkit'
entries_content = (
"entries = \\\n"
"{ 'foo/third_party/WebKit': '%s',\n"
" '%s': '%s'}\n"
) % (webkit_path, name, self.url)
scm_wrapper_webkit = self.mox.CreateMockAnything() scm_wrapper_webkit = self.mox.CreateMockAnything()
scm_wrapper_src = self.mox.CreateMockAnything() scm_wrapper_src = self.mox.CreateMockAnything()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment