Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: tests/gclient_test.py

Issue 233333003: Make it possible to refer to github-style URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Added another test for the LateOverride to work correctly with scp-style urls. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gclient_utils.py ('k') | tests/gclient_utils_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unit tests for gclient.py. 6 """Unit tests for gclient.py.
7 7
8 See gclient_smoketest.py for integration tests. 8 See gclient_smoketest.py for integration tests.
9 """ 9 """
10 10
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 {'foo': 'default_foo', 552 {'foo': 'default_foo',
553 'bar': 'os12_bar'} 553 'bar': 'os12_bar'}
554 ), 554 ),
555 ] 555 ]
556 for deps, deps_os, target_os_list, expected_deps in test_data: 556 for deps, deps_os, target_os_list, expected_deps in test_data:
557 orig_deps = copy.deepcopy(deps) 557 orig_deps = copy.deepcopy(deps)
558 result = gclient.Dependency.MergeWithOsDeps(deps, deps_os, target_os_list) 558 result = gclient.Dependency.MergeWithOsDeps(deps, deps_os, target_os_list)
559 self.assertEqual(result, expected_deps) 559 self.assertEqual(result, expected_deps)
560 self.assertEqual(deps, orig_deps) 560 self.assertEqual(deps, orig_deps)
561 561
562
563 def testLateOverride(self):
564 """Verifies expected behavior of LateOverride."""
565 url = "git@github.com:dart-lang/spark.git"
566 d = gclient.Dependency(None, 'name', 'url',
567 None, None, None, None, None, '', True)
568 late_url = d.LateOverride(url)
569 self.assertEquals(url, late_url)
570
562 def testDepsOsOverrideDepsInDepsFile(self): 571 def testDepsOsOverrideDepsInDepsFile(self):
563 """Verifies that a 'deps_os' path can override a 'deps' path. Also 572 """Verifies that a 'deps_os' path can override a 'deps' path. Also
564 see testUpdateWithOsDeps above. 573 see testUpdateWithOsDeps above.
565 """ 574 """
566 575
567 write( 576 write(
568 '.gclient', 577 '.gclient',
569 'solutions = [\n' 578 'solutions = [\n'
570 ' { "name": "foo",\n' 579 ' { "name": "foo",\n'
571 ' "url": "svn://example.com/foo",\n' 580 ' "url": "svn://example.com/foo",\n'
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) 665 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout)
657 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout, include_zero=True) 666 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout, include_zero=True)
658 sys.stderr = gclient_utils.MakeFileAutoFlush(sys.stderr) 667 sys.stderr = gclient_utils.MakeFileAutoFlush(sys.stderr)
659 sys.stderr = gclient_utils.MakeFileAnnotated(sys.stderr, include_zero=True) 668 sys.stderr = gclient_utils.MakeFileAnnotated(sys.stderr, include_zero=True)
660 logging.basicConfig( 669 logging.basicConfig(
661 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ 670 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][
662 min(sys.argv.count('-v'), 3)], 671 min(sys.argv.count('-v'), 3)],
663 format='%(relativeCreated)4d %(levelname)5s %(module)13s(' 672 format='%(relativeCreated)4d %(levelname)5s %(module)13s('
664 '%(lineno)d) %(message)s') 673 '%(lineno)d) %(message)s')
665 unittest.main() 674 unittest.main()
OLDNEW
« no previous file with comments | « gclient_utils.py ('k') | tests/gclient_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698