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

Side by Side Diff: tests/gclient_test.py

Issue 216014: gclient_scm: add test for unsupported scm (Closed)
Patch Set: Created 11 years, 3 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
« gclient_scm.py ('K') | « gclient_scm.py ('k') | no next file » | 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/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright 2008-2009 Google Inc. All Rights Reserved. 3 # Copyright 2008-2009 Google Inc. All Rights Reserved.
4 # 4 #
5 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License. 6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at 7 # You may obtain a copy of the License at
8 # 8 #
9 # http://www.apache.org/licenses/LICENSE-2.0 9 # http://www.apache.org/licenses/LICENSE-2.0
10 # 10 #
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 BaseTestCase.setUp(self) 63 BaseTestCase.setUp(self)
64 # Mock them to be sure nothing bad happens. 64 # Mock them to be sure nothing bad happens.
65 self.mox.StubOutWithMock(gclient_scm, 'CaptureSVN') 65 self.mox.StubOutWithMock(gclient_scm, 'CaptureSVN')
66 self._CaptureSVNInfo = gclient_scm.CaptureSVNInfo 66 self._CaptureSVNInfo = gclient_scm.CaptureSVNInfo
67 self.mox.StubOutWithMock(gclient_scm, 'CaptureSVNInfo') 67 self.mox.StubOutWithMock(gclient_scm, 'CaptureSVNInfo')
68 self.mox.StubOutWithMock(gclient_scm, 'CaptureSVNStatus') 68 self.mox.StubOutWithMock(gclient_scm, 'CaptureSVNStatus')
69 self.mox.StubOutWithMock(gclient_scm, 'RunSVN') 69 self.mox.StubOutWithMock(gclient_scm, 'RunSVN')
70 self.mox.StubOutWithMock(gclient_scm, 'RunSVNAndGetFileList') 70 self.mox.StubOutWithMock(gclient_scm, 'RunSVNAndGetFileList')
71 self._gclient_gclient = gclient.GClient 71 self._gclient_gclient = gclient.GClient
72 gclient.GClient = self.mox.CreateMockAnything() 72 gclient.GClient = self.mox.CreateMockAnything()
73 self._scm_wrapper = gclient_scm.SCMWrapper 73 self._scm_wrapper = gclient_scm.create_scm
74 gclient_scm.SCMWrapper = self.mox.CreateMockAnything() 74 gclient_scm.create_scm = self.mox.CreateMockAnything()
75 75
76 def tearDown(self): 76 def tearDown(self):
77 gclient.GClient = self._gclient_gclient 77 gclient.GClient = self._gclient_gclient
78 gclient_scm.SCMWrapper = self._scm_wrapper 78 gclient_scm.create_scm = self._scm_wrapper
79 BaseTestCase.tearDown(self) 79 BaseTestCase.tearDown(self)
80 80
81 81
82 class GclientTestCase(GClientBaseTestCase): 82 class GclientTestCase(GClientBaseTestCase):
83 class OptionsObject(object): 83 class OptionsObject(object):
84 def __init__(self, test_case, verbose=False, spec=None, 84 def __init__(self, test_case, verbose=False, spec=None,
85 config_filename='a_file_name', 85 config_filename='a_file_name',
86 entries_filename='a_entry_file_name', 86 entries_filename='a_entry_file_name',
87 deps_file='a_deps_file_name', force=False, nohooks=False): 87 deps_file='a_deps_file_name', force=False, nohooks=False):
88 self.verbose = verbose 88 self.verbose = verbose
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 options = self.Options() 401 options = self.Options()
402 402
403 checkout_path = os.path.join(self.root_dir, solution_name) 403 checkout_path = os.path.join(self.root_dir, solution_name)
404 gclient.os.path.exists(os.path.join(checkout_path, '.git')).AndReturn(False) 404 gclient.os.path.exists(os.path.join(checkout_path, '.git')).AndReturn(False)
405 # Expect a check for the entries file and we say there is not one. 405 # Expect a check for the entries file and we say there is not one.
406 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename) 406 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename)
407 ).AndReturn(False) 407 ).AndReturn(False)
408 408
409 # An scm will be requested for the solution. 409 # An scm will be requested for the solution.
410 scm_wrapper_sol = self.mox.CreateMockAnything() 410 scm_wrapper_sol = self.mox.CreateMockAnything()
411 gclient_scm.SCMWrapper(self.url, self.root_dir, solution_name 411 gclient_scm.create_scm(self.url, self.root_dir, solution_name
412 ).AndReturn(scm_wrapper_sol) 412 ).AndReturn(scm_wrapper_sol)
413 # Then an update will be performed. 413 # Then an update will be performed.
414 scm_wrapper_sol.RunCommand('update', options, self.args, []) 414 scm_wrapper_sol.RunCommand('update', options, self.args, [])
415 # Then an attempt will be made to read its DEPS file. 415 # Then an attempt will be made to read its DEPS file.
416 gclient.FileRead(os.path.join(self.root_dir, 416 gclient.FileRead(os.path.join(self.root_dir,
417 solution_name, 417 solution_name,
418 options.deps_file)).AndRaise(IOError(2, 'No DEPS file')) 418 options.deps_file)).AndRaise(IOError(2, 'No DEPS file'))
419 419
420 # After everything is done, an attempt is made to write an entries 420 # After everything is done, an attempt is made to write an entries
421 # file. 421 # file.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 gclient.os.path.exists(os.path.join(self.root_dir, solution_name, 'src', 458 gclient.os.path.exists(os.path.join(self.root_dir, solution_name, 'src',
459 't', '.git') 459 't', '.git')
460 ).AndReturn(False) 460 ).AndReturn(False)
461 gclient.os.path.exists(os.path.join(self.root_dir, solution_name, '.git') 461 gclient.os.path.exists(os.path.join(self.root_dir, solution_name, '.git')
462 ).AndReturn(False) 462 ).AndReturn(False)
463 # Expect a check for the entries file and we say there is not one. 463 # Expect a check for the entries file and we say there is not one.
464 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename) 464 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename)
465 ).AndReturn(False) 465 ).AndReturn(False)
466 466
467 # An scm will be requested for the solution. 467 # An scm will be requested for the solution.
468 gclient_scm.SCMWrapper(self.url, self.root_dir, solution_name 468 gclient_scm.create_scm(self.url, self.root_dir, solution_name
469 ).AndReturn(scm_wrapper_sol) 469 ).AndReturn(scm_wrapper_sol)
470 # Then an update will be performed. 470 # Then an update will be performed.
471 scm_wrapper_sol.RunCommand('update', options, self.args, []) 471 scm_wrapper_sol.RunCommand('update', options, self.args, [])
472 # Then an attempt will be made to read its DEPS file. 472 # Then an attempt will be made to read its DEPS file.
473 gclient.FileRead(os.path.join(self.root_dir, 473 gclient.FileRead(os.path.join(self.root_dir,
474 solution_name, 474 solution_name,
475 options.deps_file)).AndReturn(deps) 475 options.deps_file)).AndReturn(deps)
476 476
477 # Next we expect an scm to be request for dep src/t but it should 477 # Next we expect an scm to be request for dep src/t but it should
478 # use the url specified in deps and the relative path should now 478 # use the url specified in deps and the relative path should now
479 # be relative to the DEPS file. 479 # be relative to the DEPS file.
480 gclient_scm.SCMWrapper( 480 gclient_scm.create_scm(
481 'svn://scm.t/trunk', 481 'svn://scm.t/trunk',
482 self.root_dir, 482 self.root_dir,
483 os.path.join(solution_name, "src", "t")).AndReturn(scm_wrapper_t) 483 os.path.join(solution_name, "src", "t")).AndReturn(scm_wrapper_t)
484 scm_wrapper_t.RunCommand('update', options, self.args, []) 484 scm_wrapper_t.RunCommand('update', options, self.args, [])
485 485
486 # After everything is done, an attempt is made to write an entries 486 # After everything is done, an attempt is made to write an entries
487 # file. 487 # file.
488 gclient.FileWrite(os.path.join(self.root_dir, options.entries_filename), 488 gclient.FileWrite(os.path.join(self.root_dir, options.entries_filename),
489 entries_content) 489 entries_content)
490 490
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 gclient.os.path.exists(os.path.join(self.root_dir, 'src/n', '.git') 532 gclient.os.path.exists(os.path.join(self.root_dir, 'src/n', '.git')
533 ).AndReturn(False) 533 ).AndReturn(False)
534 gclient.os.path.exists(os.path.join(self.root_dir, 'src/t', '.git') 534 gclient.os.path.exists(os.path.join(self.root_dir, 'src/t', '.git')
535 ).AndReturn(False) 535 ).AndReturn(False)
536 536
537 # Expect a check for the entries file and we say there is not one. 537 # Expect a check for the entries file and we say there is not one.
538 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename) 538 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename)
539 ).AndReturn(False) 539 ).AndReturn(False)
540 540
541 # An scm will be requested for the solution. 541 # An scm will be requested for the solution.
542 gclient_scm.SCMWrapper(self.url, self.root_dir, solution_name 542 gclient_scm.create_scm(self.url, self.root_dir, solution_name
543 ).AndReturn(scm_wrapper_sol) 543 ).AndReturn(scm_wrapper_sol)
544 # Then an update will be performed. 544 # Then an update will be performed.
545 scm_wrapper_sol.RunCommand('update', options, self.args, []) 545 scm_wrapper_sol.RunCommand('update', options, self.args, [])
546 # Then an attempt will be made to read its DEPS file. 546 # Then an attempt will be made to read its DEPS file.
547 gclient.FileRead(os.path.join(checkout_path, options.deps_file) 547 gclient.FileRead(os.path.join(checkout_path, options.deps_file)
548 ).AndReturn(deps) 548 ).AndReturn(deps)
549 549
550 # Next we expect an scm to be request for dep src/n even though it does not 550 # Next we expect an scm to be request for dep src/n even though it does not
551 # exist in the DEPS file. 551 # exist in the DEPS file.
552 gclient_scm.SCMWrapper('svn://custom.n/trunk', 552 gclient_scm.create_scm('svn://custom.n/trunk',
553 self.root_dir, 553 self.root_dir,
554 "src/n").AndReturn(scm_wrapper_n) 554 "src/n").AndReturn(scm_wrapper_n)
555 555
556 # Next we expect an scm to be request for dep src/t but it should 556 # Next we expect an scm to be request for dep src/t but it should
557 # use the url specified in custom_deps. 557 # use the url specified in custom_deps.
558 gclient_scm.SCMWrapper('svn://custom.t/trunk', 558 gclient_scm.create_scm('svn://custom.t/trunk',
559 self.root_dir, 559 self.root_dir,
560 "src/t").AndReturn(scm_wrapper_t) 560 "src/t").AndReturn(scm_wrapper_t)
561 561
562 scm_wrapper_n.RunCommand('update', options, self.args, []) 562 scm_wrapper_n.RunCommand('update', options, self.args, [])
563 scm_wrapper_t.RunCommand('update', options, self.args, []) 563 scm_wrapper_t.RunCommand('update', options, self.args, [])
564 564
565 # NOTE: the dep src/b should not create an scm at all. 565 # NOTE: the dep src/b should not create an scm at all.
566 566
567 # After everything is done, an attempt is made to write an entries 567 # After everything is done, an attempt is made to write an entries
568 # file. 568 # file.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 gclient.os.path.exists(os.path.join(self.root_dir, name_b, '.git') 618 gclient.os.path.exists(os.path.join(self.root_dir, name_b, '.git')
619 ).AndReturn(False) 619 ).AndReturn(False)
620 gclient.os.path.exists(os.path.join(self.root_dir, 'src/t', '.git') 620 gclient.os.path.exists(os.path.join(self.root_dir, 'src/t', '.git')
621 ).AndReturn(False) 621 ).AndReturn(False)
622 622
623 # Expect a check for the entries file and we say there is not one. 623 # Expect a check for the entries file and we say there is not one.
624 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename) 624 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename)
625 ).AndReturn(False) 625 ).AndReturn(False)
626 626
627 # An scm will be requested for the first solution. 627 # An scm will be requested for the first solution.
628 gclient_scm.SCMWrapper(url_a, self.root_dir, name_a).AndReturn( 628 gclient_scm.create_scm(url_a, self.root_dir, name_a).AndReturn(
629 scm_wrapper_a) 629 scm_wrapper_a)
630 # Then an attempt will be made to read it's DEPS file. 630 # Then an attempt will be made to read it's DEPS file.
631 gclient.FileRead(os.path.join(self.root_dir, name_a, options.deps_file) 631 gclient.FileRead(os.path.join(self.root_dir, name_a, options.deps_file)
632 ).AndReturn(deps_a) 632 ).AndReturn(deps_a)
633 # Then an update will be performed. 633 # Then an update will be performed.
634 scm_wrapper_a.RunCommand('update', options, self.args, []) 634 scm_wrapper_a.RunCommand('update', options, self.args, [])
635 635
636 # An scm will be requested for the second solution. 636 # An scm will be requested for the second solution.
637 gclient_scm.SCMWrapper(url_b, self.root_dir, name_b).AndReturn( 637 gclient_scm.create_scm(url_b, self.root_dir, name_b).AndReturn(
638 scm_wrapper_b) 638 scm_wrapper_b)
639 # Then an attempt will be made to read its DEPS file. 639 # Then an attempt will be made to read its DEPS file.
640 gclient.FileRead(os.path.join(self.root_dir, name_b, options.deps_file) 640 gclient.FileRead(os.path.join(self.root_dir, name_b, options.deps_file)
641 ).AndReturn(deps_b) 641 ).AndReturn(deps_b)
642 # Then an update will be performed. 642 # Then an update will be performed.
643 scm_wrapper_b.RunCommand('update', options, self.args, []) 643 scm_wrapper_b.RunCommand('update', options, self.args, [])
644 644
645 # Finally, an scm is requested for the shared dep. 645 # Finally, an scm is requested for the shared dep.
646 gclient_scm.SCMWrapper('http://svn.t/trunk', self.root_dir, 'src/t' 646 gclient_scm.create_scm('http://svn.t/trunk', self.root_dir, 'src/t'
647 ).AndReturn(scm_wrapper_dep) 647 ).AndReturn(scm_wrapper_dep)
648 # And an update is run on it. 648 # And an update is run on it.
649 scm_wrapper_dep.RunCommand('update', options, self.args, []) 649 scm_wrapper_dep.RunCommand('update', options, self.args, [])
650 650
651 # After everything is done, an attempt is made to write an entries file. 651 # After everything is done, an attempt is made to write an entries file.
652 gclient.FileWrite(os.path.join(self.root_dir, options.entries_filename), 652 gclient.FileWrite(os.path.join(self.root_dir, options.entries_filename),
653 entries_content) 653 entries_content)
654 654
655 self.mox.ReplayAll() 655 self.mox.ReplayAll()
656 client = self._gclient_gclient(self.root_dir, options) 656 client = self._gclient_gclient(self.root_dir, options)
657 client.SetConfig(gclient_config) 657 client.SetConfig(gclient_config)
658 client.RunOnDeps('update', self.args) 658 client.RunOnDeps('update', self.args)
659 659
660 def testRunOnDepsSuccess(self): 660 def testRunOnDepsSuccess(self):
661 # Fake .gclient file. 661 # Fake .gclient file.
662 name = 'testRunOnDepsSuccess_solution_name' 662 name = 'testRunOnDepsSuccess_solution_name'
663 gclient_config = """solutions = [ { 663 gclient_config = """solutions = [ {
664 'name': '%s', 664 'name': '%s',
665 'url': '%s', 665 'url': '%s',
666 'custom_deps': {}, 666 'custom_deps': {},
667 }, ]""" % (name, self.url) 667 }, ]""" % (name, self.url)
668 668
669 options = self.Options() 669 options = self.Options()
670 gclient.os.path.exists(os.path.join(self.root_dir, name, '.git') 670 gclient.os.path.exists(os.path.join(self.root_dir, name, '.git')
671 ).AndReturn(False) 671 ).AndReturn(False)
672 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename) 672 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename)
673 ).AndReturn(False) 673 ).AndReturn(False)
674 gclient_scm.SCMWrapper(self.url, self.root_dir, name).AndReturn( 674 gclient_scm.create_scm(self.url, self.root_dir, name).AndReturn(
675 gclient_scm.SCMWrapper) 675 gclient_scm.create_scm)
676 gclient_scm.SCMWrapper.RunCommand('update', options, self.args, []) 676 gclient_scm.create_scm.RunCommand('update', options, self.args, [])
677 gclient.FileRead(os.path.join(self.root_dir, name, options.deps_file) 677 gclient.FileRead(os.path.join(self.root_dir, name, options.deps_file)
678 ).AndReturn("Boo = 'a'") 678 ).AndReturn("Boo = 'a'")
679 gclient.FileWrite(os.path.join(self.root_dir, options.entries_filename), 679 gclient.FileWrite(os.path.join(self.root_dir, options.entries_filename),
680 'entries = [\n "%s",\n]\n' % name) 680 'entries = [\n "%s",\n]\n' % name)
681 681
682 self.mox.ReplayAll() 682 self.mox.ReplayAll()
683 client = self._gclient_gclient(self.root_dir, options) 683 client = self._gclient_gclient(self.root_dir, options)
684 client.SetConfig(gclient_config) 684 client.SetConfig(gclient_config)
685 client.RunOnDeps('update', self.args) 685 client.RunOnDeps('update', self.args)
686 686
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 ).AndReturn(False) 758 ).AndReturn(False)
759 gclient.os.path.exists(os.path.join(self.root_dir, 759 gclient.os.path.exists(os.path.join(self.root_dir,
760 'src/third_party/python_24', '.git') 760 'src/third_party/python_24', '.git')
761 ).AndReturn(False) 761 ).AndReturn(False)
762 gclient.os.path.exists(os.path.join(self.root_dir, 'src/breakpad/bar', 762 gclient.os.path.exists(os.path.join(self.root_dir, 'src/breakpad/bar',
763 '.git') 763 '.git')
764 ).AndReturn(False) 764 ).AndReturn(False)
765 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename) 765 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename)
766 ).AndReturn(False) 766 ).AndReturn(False)
767 767
768 gclient_scm.SCMWrapper(self.url, self.root_dir, 'src').AndReturn( 768 gclient_scm.create_scm(self.url, self.root_dir, 'src').AndReturn(
769 scm_wrapper_src) 769 scm_wrapper_src)
770 scm_wrapper_src.RunCommand('update', mox.Func(OptIsRev123), self.args, []) 770 scm_wrapper_src.RunCommand('update', mox.Func(OptIsRev123), self.args, [])
771 771
772 gclient_scm.SCMWrapper(self.url, self.root_dir, 772 gclient_scm.create_scm(self.url, self.root_dir,
773 None).AndReturn(scm_wrapper_src2) 773 None).AndReturn(scm_wrapper_src2)
774 scm_wrapper_src2.FullUrlForRelativeUrl('/trunk/deps/third_party/cygwin@3248' 774 scm_wrapper_src2.FullUrlForRelativeUrl('/trunk/deps/third_party/cygwin@3248'
775 ).AndReturn(cygwin_path) 775 ).AndReturn(cygwin_path)
776 776
777 gclient_scm.SCMWrapper(self.url, self.root_dir, 777 gclient_scm.create_scm(self.url, self.root_dir,
778 None).AndReturn(scm_wrapper_src2) 778 None).AndReturn(scm_wrapper_src2)
779 scm_wrapper_src2.FullUrlForRelativeUrl('/trunk/deps/third_party/WebKit' 779 scm_wrapper_src2.FullUrlForRelativeUrl('/trunk/deps/third_party/WebKit'
780 ).AndReturn(webkit_path) 780 ).AndReturn(webkit_path)
781 781
782 gclient_scm.SCMWrapper(webkit_path, self.root_dir, 782 gclient_scm.create_scm(webkit_path, self.root_dir,
783 'foo/third_party/WebKit').AndReturn(scm_wrapper_webkit) 783 'foo/third_party/WebKit').AndReturn(scm_wrapper_webkit)
784 scm_wrapper_webkit.RunCommand('update', mox.Func(OptIsRev42), self.args, []) 784 scm_wrapper_webkit.RunCommand('update', mox.Func(OptIsRev42), self.args, [])
785 785
786 gclient_scm.SCMWrapper( 786 gclient_scm.create_scm(
787 'http://google-breakpad.googlecode.com/svn/trunk/src@285', 787 'http://google-breakpad.googlecode.com/svn/trunk/src@285',
788 self.root_dir, 'src/breakpad/bar').AndReturn(scm_wrapper_breakpad) 788 self.root_dir, 'src/breakpad/bar').AndReturn(scm_wrapper_breakpad)
789 scm_wrapper_breakpad.RunCommand('update', mox.Func(OptIsRevNone), 789 scm_wrapper_breakpad.RunCommand('update', mox.Func(OptIsRevNone),
790 self.args, []) 790 self.args, [])
791 791
792 gclient_scm.SCMWrapper(cygwin_path, self.root_dir, 792 gclient_scm.create_scm(cygwin_path, self.root_dir,
793 'src/third_party/cygwin').AndReturn(scm_wrapper_cygwin) 793 'src/third_party/cygwin').AndReturn(scm_wrapper_cygwin)
794 scm_wrapper_cygwin.RunCommand('update', mox.Func(OptIsRev333), self.args, 794 scm_wrapper_cygwin.RunCommand('update', mox.Func(OptIsRev333), self.args,
795 []) 795 [])
796 796
797 gclient_scm.SCMWrapper('svn://random_server:123/trunk/python_24@5580', 797 gclient_scm.create_scm('svn://random_server:123/trunk/python_24@5580',
798 self.root_dir, 798 self.root_dir,
799 'src/third_party/python_24').AndReturn( 799 'src/third_party/python_24').AndReturn(
800 scm_wrapper_python) 800 scm_wrapper_python)
801 scm_wrapper_python.RunCommand('update', mox.Func(OptIsRevNone), self.args, 801 scm_wrapper_python.RunCommand('update', mox.Func(OptIsRevNone), self.args,
802 []) 802 [])
803 803
804 self.mox.ReplayAll() 804 self.mox.ReplayAll()
805 client = self._gclient_gclient(self.root_dir, options) 805 client = self._gclient_gclient(self.root_dir, options)
806 client.SetConfig(gclient_config) 806 client.SetConfig(gclient_config)
807 client.RunOnDeps('update', self.args) 807 client.RunOnDeps('update', self.args)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 ).AndReturn(deps_content) 863 ).AndReturn(deps_content)
864 gclient.FileWrite(os.path.join(self.root_dir, options.entries_filename), 864 gclient.FileWrite(os.path.join(self.root_dir, options.entries_filename),
865 entries_content) 865 entries_content)
866 866
867 gclient.os.path.exists(os.path.join(self.root_dir, 'foo/third_party/WebKit', 867 gclient.os.path.exists(os.path.join(self.root_dir, 'foo/third_party/WebKit',
868 '.git')).AndReturn(False) 868 '.git')).AndReturn(False)
869 gclient.os.path.exists(os.path.join(self.root_dir, name, '.git') 869 gclient.os.path.exists(os.path.join(self.root_dir, name, '.git')
870 ).AndReturn(False) 870 ).AndReturn(False)
871 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename) 871 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename)
872 ).AndReturn(False) 872 ).AndReturn(False)
873 gclient_scm.SCMWrapper(self.url, self.root_dir, name).AndReturn( 873 gclient_scm.create_scm(self.url, self.root_dir, name).AndReturn(
874 gclient_scm.SCMWrapper) 874 gclient_scm.create_scm)
875 gclient_scm.SCMWrapper.RunCommand('update', options, self.args, []) 875 gclient_scm.create_scm.RunCommand('update', options, self.args, [])
876 876
877 gclient_scm.SCMWrapper(self.url, self.root_dir, 877 gclient_scm.create_scm(self.url, self.root_dir,
878 None).AndReturn(scm_wrapper_src) 878 None).AndReturn(scm_wrapper_src)
879 scm_wrapper_src.FullUrlForRelativeUrl('/trunk/bar/WebKit' 879 scm_wrapper_src.FullUrlForRelativeUrl('/trunk/bar/WebKit'
880 ).AndReturn(webkit_path) 880 ).AndReturn(webkit_path)
881 881
882 gclient_scm.SCMWrapper(webkit_path, self.root_dir, 882 gclient_scm.create_scm(webkit_path, self.root_dir,
883 'foo/third_party/WebKit').AndReturn(gclient_scm.SCMWrapper) 883 'foo/third_party/WebKit').AndReturn(gclient_scm.create_scm)
884 gclient_scm.SCMWrapper.RunCommand('update', options, self.args, []) 884 gclient_scm.create_scm.RunCommand('update', options, self.args, [])
885 885
886 self.mox.ReplayAll() 886 self.mox.ReplayAll()
887 client = self._gclient_gclient(self.root_dir, options) 887 client = self._gclient_gclient(self.root_dir, options)
888 client.SetConfig(gclient_config) 888 client.SetConfig(gclient_config)
889 client.RunOnDeps('update', self.args) 889 client.RunOnDeps('update', self.args)
890 890
891 def testRunOnDepsSuccessCustomVars(self): 891 def testRunOnDepsSuccessCustomVars(self):
892 # Fake .gclient file. 892 # Fake .gclient file.
893 name = 'testRunOnDepsSuccessCustomVars_solution_name' 893 name = 'testRunOnDepsSuccessCustomVars_solution_name'
894 gclient_config = """solutions = [ { 894 gclient_config = """solutions = [ {
(...skipping 24 matching lines...) Expand all
919 gclient.FileWrite(os.path.join(self.root_dir, options.entries_filename), 919 gclient.FileWrite(os.path.join(self.root_dir, options.entries_filename),
920 entries_content) 920 entries_content)
921 921
922 gclient.os.path.exists(os.path.join(self.root_dir, 'foo/third_party/WebKit', 922 gclient.os.path.exists(os.path.join(self.root_dir, 'foo/third_party/WebKit',
923 '.git') 923 '.git')
924 ).AndReturn(False) 924 ).AndReturn(False)
925 gclient.os.path.exists(os.path.join(self.root_dir, name, '.git') 925 gclient.os.path.exists(os.path.join(self.root_dir, name, '.git')
926 ).AndReturn(False) 926 ).AndReturn(False)
927 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename) 927 gclient.os.path.exists(os.path.join(self.root_dir, options.entries_filename)
928 ).AndReturn(False) 928 ).AndReturn(False)
929 gclient_scm.SCMWrapper(self.url, self.root_dir, name).AndReturn( 929 gclient_scm.create_scm(self.url, self.root_dir, name).AndReturn(
930 gclient_scm.SCMWrapper) 930 gclient_scm.create_scm)
931 gclient_scm.SCMWrapper.RunCommand('update', options, self.args, []) 931 gclient_scm.create_scm.RunCommand('update', options, self.args, [])
932 932
933 gclient_scm.SCMWrapper(self.url, self.root_dir, 933 gclient_scm.create_scm(self.url, self.root_dir,
934 None).AndReturn(scm_wrapper_src) 934 None).AndReturn(scm_wrapper_src)
935 scm_wrapper_src.FullUrlForRelativeUrl('/trunk/bar_custom/WebKit' 935 scm_wrapper_src.FullUrlForRelativeUrl('/trunk/bar_custom/WebKit'
936 ).AndReturn(webkit_path) 936 ).AndReturn(webkit_path)
937 937
938 gclient_scm.SCMWrapper(webkit_path, self.root_dir, 938 gclient_scm.create_scm(webkit_path, self.root_dir,
939 'foo/third_party/WebKit').AndReturn(gclient_scm.SCMWrapper) 939 'foo/third_party/WebKit').AndReturn(gclient_scm.create_scm)
940 gclient_scm.SCMWrapper.RunCommand('update', options, self.args, []) 940 gclient_scm.create_scm.RunCommand('update', options, self.args, [])
941 941
942 self.mox.ReplayAll() 942 self.mox.ReplayAll()
943 client = self._gclient_gclient(self.root_dir, options) 943 client = self._gclient_gclient(self.root_dir, options)
944 client.SetConfig(gclient_config) 944 client.SetConfig(gclient_config)
945 client.RunOnDeps('update', self.args) 945 client.RunOnDeps('update', self.args)
946 946
947 def testRunOnDepsFailureVars(self): 947 def testRunOnDepsFailureVars(self):
948 # Fake .gclient file. 948 # Fake .gclient file.
949 name = 'testRunOnDepsFailureVars_solution_name' 949 name = 'testRunOnDepsFailureVars_solution_name'
950 gclient_config = """solutions = [ { 950 gclient_config = """solutions = [ {
951 'name': '%s', 951 'name': '%s',
952 'url': '%s', 952 'url': '%s',
953 'custom_deps': {}, 953 'custom_deps': {},
954 'custom_vars': {}, 954 'custom_vars': {},
955 }, ]""" % (name, self.url) 955 }, ]""" % (name, self.url)
956 # Fake DEPS file. 956 # Fake DEPS file.
957 deps_content = """deps = { 957 deps_content = """deps = {
958 'foo/third_party/WebKit': Var('webkit') + 'WebKit', 958 'foo/third_party/WebKit': Var('webkit') + 'WebKit',
959 }""" 959 }"""
960 960
961 options = self.Options() 961 options = self.Options()
962 gclient.FileRead(os.path.join(self.root_dir, name, options.deps_file) 962 gclient.FileRead(os.path.join(self.root_dir, name, options.deps_file)
963 ).AndReturn(deps_content) 963 ).AndReturn(deps_content)
964 gclient_scm.SCMWrapper(self.url, self.root_dir, name).AndReturn( 964 gclient_scm.create_scm(self.url, self.root_dir, name).AndReturn(
965 gclient_scm.SCMWrapper) 965 gclient_scm.create_scm)
966 gclient_scm.SCMWrapper.RunCommand('update', options, self.args, []) 966 gclient_scm.create_scm.RunCommand('update', options, self.args, [])
967 967
968 self.mox.ReplayAll() 968 self.mox.ReplayAll()
969 client = self._gclient_gclient(self.root_dir, options) 969 client = self._gclient_gclient(self.root_dir, options)
970 client.SetConfig(gclient_config) 970 client.SetConfig(gclient_config)
971 exception = "Var is not defined: webkit" 971 exception = "Var is not defined: webkit"
972 try: 972 try:
973 client.RunOnDeps('update', self.args) 973 client.RunOnDeps('update', self.args)
974 except gclient.Error, e: 974 except gclient.Error, e:
975 self.assertEquals(e.args[0], exception) 975 self.assertEquals(e.args[0], exception)
976 else: 976 else:
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 def setUp(self): 1031 def setUp(self):
1032 GClientBaseTestCase.setUp(self) 1032 GClientBaseTestCase.setUp(self)
1033 self.root_dir = self.Dir() 1033 self.root_dir = self.Dir()
1034 self.args = self.Args() 1034 self.args = self.Args()
1035 self.url = self.Url() 1035 self.url = self.Url()
1036 self.relpath = 'asf' 1036 self.relpath = 'asf'
1037 1037
1038 def testDir(self): 1038 def testDir(self):
1039 members = [ 1039 members = [
1040 'FullUrlForRelativeUrl', 'RunCommand', 'cleanup', 'diff', 'export', 1040 'FullUrlForRelativeUrl', 'RunCommand', 'cleanup', 'diff', 'export',
1041 'pack', 'relpath', 'revert', 'scm_name', 'status', 'update', 'url', 1041 'pack', 'relpath', 'revert', 'runhooks', 'scm_name', 'status',
1042 'update', 'url',
1042 ] 1043 ]
1043 1044
1044 # If you add a member, be sure to add the relevant test! 1045 # If you add a member, be sure to add the relevant test!
1045 self.compareMembers(self._scm_wrapper(), members) 1046 self.compareMembers(self._scm_wrapper(self.url,
1047 self.root_dir,
1048 self.relpath),
1049 members)
1050
1051 def testUnsupportedSCM(self):
1052 args = [self.url, self.root_dir, self.relpath]
1053 kwargs = {'scm_name' : 'foo'}
1054 exception_msg = 'Unsupported scm %(scm_name)s' % kwargs
1055 self.assertRaisesError(exception_msg, self._scm_wrapper, *args, **kwargs)
1046 1056
1047 def testFullUrlForRelativeUrl(self): 1057 def testFullUrlForRelativeUrl(self):
1048 self.url = 'svn://a/b/c/d' 1058 self.url = 'svn://a/b/c/d'
1049 1059
1050 self.mox.ReplayAll() 1060 self.mox.ReplayAll()
1051 scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, 1061 scm = self._scm_wrapper(self.url, self.root_dir, self.relpath)
1052 relpath=self.relpath)
1053 self.assertEqual(scm.FullUrlForRelativeUrl('/crap'), 'svn://a/b/crap') 1062 self.assertEqual(scm.FullUrlForRelativeUrl('/crap'), 'svn://a/b/crap')
1054 1063
1055 def testRunCommandException(self): 1064 def testRunCommandException(self):
1056 options = self.Options(verbose=False) 1065 options = self.Options(verbose=False)
1057 gclient.os.path.exists(os.path.join(self.root_dir, self.relpath, '.git') 1066 gclient.os.path.exists(os.path.join(self.root_dir, self.relpath, '.git')
1058 ).AndReturn(False) 1067 ).AndReturn(False)
1059 1068
1060 self.mox.ReplayAll() 1069 self.mox.ReplayAll()
1061 scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, 1070 scm = self._scm_wrapper(self.url, self.root_dir, self.relpath)
1062 relpath=self.relpath)
1063 exception = "Unsupported argument(s): %s" % ','.join(self.args) 1071 exception = "Unsupported argument(s): %s" % ','.join(self.args)
1064 self.assertRaisesError(exception, self._scm_wrapper.RunCommand, 1072 self.assertRaisesError(exception, scm.RunCommand,
1065 scm, 'update', options, self.args) 1073 'update', options, self.args)
1066 1074
1067 def testRunCommandUnknown(self): 1075 def testRunCommandUnknown(self):
1068 # TODO(maruel): if ever used. 1076 # TODO(maruel): if ever used.
1069 pass 1077 pass
1070 1078
1071 def testRevertMissing(self): 1079 def testRevertMissing(self):
1072 options = self.Options(verbose=True) 1080 options = self.Options(verbose=True)
1073 base_path = os.path.join(self.root_dir, self.relpath) 1081 base_path = os.path.join(self.root_dir, self.relpath)
1074 gclient.os.path.isdir(base_path).AndReturn(False) 1082 gclient.os.path.isdir(base_path).AndReturn(False)
1075 # It'll to a checkout instead. 1083 # It'll to a checkout instead.
1076 gclient.os.path.exists(os.path.join(base_path, '.git')).AndReturn(False) 1084 gclient.os.path.exists(os.path.join(base_path, '.git')).AndReturn(False)
1077 print("\n_____ %s is missing, synching instead" % self.relpath) 1085 print("\n_____ %s is missing, synching instead" % self.relpath)
1078 # Checkout. 1086 # Checkout.
1079 gclient.os.path.exists(base_path).AndReturn(False) 1087 gclient.os.path.exists(base_path).AndReturn(False)
1080 files_list = self.mox.CreateMockAnything() 1088 files_list = self.mox.CreateMockAnything()
1081 gclient_scm.RunSVNAndGetFileList(['checkout', self.url, base_path], 1089 gclient_scm.RunSVNAndGetFileList(['checkout', self.url, base_path],
1082 self.root_dir, files_list) 1090 self.root_dir, files_list)
1083 1091
1084 self.mox.ReplayAll() 1092 self.mox.ReplayAll()
1085 scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, 1093 scm = self._scm_wrapper(self.url, self.root_dir, self.relpath)
1086 relpath=self.relpath)
1087 scm.revert(options, self.args, files_list) 1094 scm.revert(options, self.args, files_list)
1088 1095
1089 def testRevertNone(self): 1096 def testRevertNone(self):
1090 options = self.Options(verbose=True) 1097 options = self.Options(verbose=True)
1091 base_path = os.path.join(self.root_dir, self.relpath) 1098 base_path = os.path.join(self.root_dir, self.relpath)
1092 gclient.os.path.isdir(base_path).AndReturn(True) 1099 gclient.os.path.isdir(base_path).AndReturn(True)
1093 gclient_scm.CaptureSVNStatus(base_path).AndReturn([]) 1100 gclient_scm.CaptureSVNStatus(base_path).AndReturn([])
1094 1101
1095 self.mox.ReplayAll() 1102 self.mox.ReplayAll()
1096 scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, 1103 scm = self._scm_wrapper(self.url, self.root_dir, self.relpath)
1097 relpath=self.relpath)
1098 file_list = [] 1104 file_list = []
1099 scm.revert(options, self.args, file_list) 1105 scm.revert(options, self.args, file_list)
1100 1106
1101 def testRevert2Files(self): 1107 def testRevert2Files(self):
1102 options = self.Options(verbose=True) 1108 options = self.Options(verbose=True)
1103 base_path = os.path.join(self.root_dir, self.relpath) 1109 base_path = os.path.join(self.root_dir, self.relpath)
1104 gclient.os.path.isdir(base_path).AndReturn(True) 1110 gclient.os.path.isdir(base_path).AndReturn(True)
1105 items = [ 1111 items = [
1106 ('M ', 'a'), 1112 ('M ', 'a'),
1107 ('A ', 'b'), 1113 ('A ', 'b'),
1108 ] 1114 ]
1109 gclient_scm.CaptureSVNStatus(base_path).AndReturn(items) 1115 gclient_scm.CaptureSVNStatus(base_path).AndReturn(items)
1110 1116
1111 print(os.path.join(base_path, 'a')) 1117 print(os.path.join(base_path, 'a'))
1112 print(os.path.join(base_path, 'b')) 1118 print(os.path.join(base_path, 'b'))
1113 gclient_scm.RunSVN(['revert', 'a', 'b'], base_path) 1119 gclient_scm.RunSVN(['revert', 'a', 'b'], base_path)
1114 1120
1115 self.mox.ReplayAll() 1121 self.mox.ReplayAll()
1116 scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, 1122 scm = self._scm_wrapper(self.url, self.root_dir, self.relpath)
1117 relpath=self.relpath)
1118 file_list = [] 1123 file_list = []
1119 scm.revert(options, self.args, file_list) 1124 scm.revert(options, self.args, file_list)
1120 1125
1121 def testRevertUnversionedUnexpectedFile(self): 1126 def testRevertUnversionedUnexpectedFile(self):
1122 options = self.Options(verbose=True) 1127 options = self.Options(verbose=True)
1123 base_path = os.path.join(self.root_dir, self.relpath) 1128 base_path = os.path.join(self.root_dir, self.relpath)
1124 gclient.os.path.isdir(base_path).AndReturn(True) 1129 gclient.os.path.isdir(base_path).AndReturn(True)
1125 items = [ 1130 items = [
1126 ('~ ', 'a'), 1131 ('~ ', 'a'),
1127 ] 1132 ]
(...skipping 11 matching lines...) Expand all
1139 scm.revert(options, self.args, file_list) 1144 scm.revert(options, self.args, file_list)
1140 1145
1141 def testStatus(self): 1146 def testStatus(self):
1142 options = self.Options(verbose=True) 1147 options = self.Options(verbose=True)
1143 base_path = os.path.join(self.root_dir, self.relpath) 1148 base_path = os.path.join(self.root_dir, self.relpath)
1144 gclient.os.path.isdir(base_path).AndReturn(True) 1149 gclient.os.path.isdir(base_path).AndReturn(True)
1145 gclient_scm.RunSVNAndGetFileList(['status'] + self.args, base_path, 1150 gclient_scm.RunSVNAndGetFileList(['status'] + self.args, base_path,
1146 []).AndReturn(None) 1151 []).AndReturn(None)
1147 1152
1148 self.mox.ReplayAll() 1153 self.mox.ReplayAll()
1149 scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, 1154 scm = self._scm_wrapper(self.url, self.root_dir, self.relpath)
1150 relpath=self.relpath)
1151 file_list = [] 1155 file_list = []
1152 self.assertEqual(scm.status(options, self.args, file_list), None) 1156 self.assertEqual(scm.status(options, self.args, file_list), None)
1153 1157
1154 1158
1155 # TODO(maruel): TEST REVISIONS!!! 1159 # TODO(maruel): TEST REVISIONS!!!
1156 # TODO(maruel): TEST RELOCATE!!! 1160 # TODO(maruel): TEST RELOCATE!!!
1157 def testUpdateCheckout(self): 1161 def testUpdateCheckout(self):
1158 options = self.Options(verbose=True) 1162 options = self.Options(verbose=True)
1159 base_path = os.path.join(self.root_dir, self.relpath) 1163 base_path = os.path.join(self.root_dir, self.relpath)
1160 file_info = gclient_utils.PrintableObject() 1164 file_info = gclient_utils.PrintableObject()
1161 file_info.root = 'blah' 1165 file_info.root = 'blah'
1162 file_info.url = self.url 1166 file_info.url = self.url
1163 file_info.uuid = 'ABC' 1167 file_info.uuid = 'ABC'
1164 file_info.revision = 42 1168 file_info.revision = 42
1165 gclient.os.path.exists(os.path.join(base_path, '.git')).AndReturn(False) 1169 gclient.os.path.exists(os.path.join(base_path, '.git')).AndReturn(False)
1166 # Checkout. 1170 # Checkout.
1167 gclient.os.path.exists(base_path).AndReturn(False) 1171 gclient.os.path.exists(base_path).AndReturn(False)
1168 files_list = self.mox.CreateMockAnything() 1172 files_list = self.mox.CreateMockAnything()
1169 gclient_scm.RunSVNAndGetFileList(['checkout', self.url, base_path], 1173 gclient_scm.RunSVNAndGetFileList(['checkout', self.url, base_path],
1170 self.root_dir, files_list) 1174 self.root_dir, files_list)
1171 self.mox.ReplayAll() 1175 self.mox.ReplayAll()
1172 scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, 1176 scm = self._scm_wrapper(self.url, self.root_dir, self.relpath)
1173 relpath=self.relpath)
1174 scm.update(options, (), files_list) 1177 scm.update(options, (), files_list)
1175 1178
1176 def testUpdateUpdate(self): 1179 def testUpdateUpdate(self):
1177 options = self.Options(verbose=True) 1180 options = self.Options(verbose=True)
1178 base_path = os.path.join(self.root_dir, self.relpath) 1181 base_path = os.path.join(self.root_dir, self.relpath)
1179 options.force = True 1182 options.force = True
1180 options.nohooks = False 1183 options.nohooks = False
1181 file_info = { 1184 file_info = {
1182 'Repository Root': 'blah', 1185 'Repository Root': 'blah',
1183 'URL': self.url, 1186 'URL': self.url,
1184 'UUID': 'ABC', 1187 'UUID': 'ABC',
1185 'Revision': 42, 1188 'Revision': 42,
1186 } 1189 }
1187 gclient.os.path.exists(os.path.join(base_path, '.git')).AndReturn(False) 1190 gclient.os.path.exists(os.path.join(base_path, '.git')).AndReturn(False)
1188 # Checkout or update. 1191 # Checkout or update.
1189 gclient.os.path.exists(base_path).AndReturn(True) 1192 gclient.os.path.exists(base_path).AndReturn(True)
1190 gclient_scm.CaptureSVNInfo(os.path.join(base_path, "."), '.' 1193 gclient_scm.CaptureSVNInfo(os.path.join(base_path, "."), '.'
1191 ).AndReturn(file_info) 1194 ).AndReturn(file_info)
1192 # Cheat a bit here. 1195 # Cheat a bit here.
1193 gclient_scm.CaptureSVNInfo(file_info['URL'], '.').AndReturn(file_info) 1196 gclient_scm.CaptureSVNInfo(file_info['URL'], '.').AndReturn(file_info)
1194 additional_args = [] 1197 additional_args = []
1195 if options.manually_grab_svn_rev: 1198 if options.manually_grab_svn_rev:
1196 additional_args = ['--revision', str(file_info['Revision'])] 1199 additional_args = ['--revision', str(file_info['Revision'])]
1197 files_list = [] 1200 files_list = []
1198 gclient_scm.RunSVNAndGetFileList(['update', base_path] + additional_args, 1201 gclient_scm.RunSVNAndGetFileList(['update', base_path] + additional_args,
1199 self.root_dir, files_list) 1202 self.root_dir, files_list)
1200 1203
1201 self.mox.ReplayAll() 1204 self.mox.ReplayAll()
1202 scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, 1205 scm = self._scm_wrapper(self.url, self.root_dir, self.relpath)
1203 relpath=self.relpath)
1204 scm.update(options, (), files_list) 1206 scm.update(options, (), files_list)
1205 1207
1206 def testUpdateGit(self): 1208 def testUpdateGit(self):
1207 options = self.Options(verbose=True) 1209 options = self.Options(verbose=True)
1208 gclient.os.path.exists(os.path.join(self.root_dir, self.relpath, '.git') 1210 gclient.os.path.exists(os.path.join(self.root_dir, self.relpath, '.git')
1209 ).AndReturn(True) 1211 ).AndReturn(True)
1210 print("________ found .git directory; skipping %s" % self.relpath) 1212 print("________ found .git directory; skipping %s" % self.relpath)
1211 1213
1212 self.mox.ReplayAll() 1214 self.mox.ReplayAll()
1213 scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, 1215 scm = self._scm_wrapper(self.url, self.root_dir, self.relpath)
1214 relpath=self.relpath)
1215 file_list = [] 1216 file_list = []
1216 scm.update(options, self.args, file_list) 1217 scm.update(options, self.args, file_list)
1217 1218
1218 def testGetSVNFileInfo(self): 1219 def testGetSVNFileInfo(self):
1219 xml_text = r"""<?xml version="1.0"?> 1220 xml_text = r"""<?xml version="1.0"?>
1220 <info> 1221 <info>
1221 <entry kind="file" path="%s" revision="14628"> 1222 <entry kind="file" path="%s" revision="14628">
1222 <url>http://src.chromium.org/svn/trunk/src/chrome/app/d</url> 1223 <url>http://src.chromium.org/svn/trunk/src/chrome/app/d</url>
1223 <repository><root>http://src.chromium.org/svn</root></repository> 1224 <repository><root>http://src.chromium.org/svn</root></repository>
1224 <wc-info> 1225 <wc-info>
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1403 """ 1404 """
1404 gclient_scm.CaptureSVN = CaptureSVNMock 1405 gclient_scm.CaptureSVN = CaptureSVNMock
1405 info = gclient_scm.CaptureSVNStatus(None) 1406 info = gclient_scm.CaptureSVNStatus(None)
1406 self.assertEquals(info, []) 1407 self.assertEquals(info, [])
1407 1408
1408 1409
1409 if __name__ == '__main__': 1410 if __name__ == '__main__':
1410 unittest.main() 1411 unittest.main()
1411 1412
1412 # vim: ts=2:sw=2:tw=80:et: 1413 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« gclient_scm.py ('K') | « gclient_scm.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698