Example #1
0
 def testMembersChanged(self):
   members = [
     'GenerateDiff', 'GetFileNames', 'GetLocalRoot',
     'GetPatchName', 'ProcessOptions', 'options'
   ]
   # If this test fails, you should add the relevant test.
   self.compareMembers(trychange.GIT(None), members)
Example #2
0
 def setUp(self):
   self.fake_root = trychange.os.path.join(
       trychange.os.path.dirname(__file__), 'fake_root')
   self.expected_files = ['foo.txt', 'bar.txt']
   options = optparse.Values()
   options.files = self.expected_files
   self.git = trychange.GIT(options)
   SuperMoxTestBase.setUp(self)
Example #3
0
 def testBasic(self):
   trychange.scm.GIT.GetCheckoutRoot(self.fake_root).AndReturn(self.fake_root)
   trychange.scm.GIT.GetUpstreamBranch(self.fake_root).AndReturn('somewhere')
   trychange.scm.GIT.GenerateDiff(self.fake_root,
                                  full_move=True,
                                  files=['foo.txt', 'bar.txt'],
                                  branch='somewhere').AndReturn('A diff')
   trychange.scm.GIT.GetPatchName(self.fake_root).AndReturn('bleh-1233')
   trychange.scm.GIT.GetEmail(self.fake_root).AndReturn('*****@*****.**')
   self.mox.ReplayAll()
   git = trychange.GIT(self.options, self.fake_root)
   self.assertEqual(git.GetFileNames(), self.expected_files)
   self.assertEqual(git.checkout_root, self.fake_root)
   self.assertEqual(git.GenerateDiff(), 'A diff')