Beispiel #1
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)
Beispiel #2
0
  def setUp(self):
    SuperMoxTestBase.setUp(self)
    self.mox.StubOutWithMock(revert, 'gcl')
    self.mox.StubOutWithMock(revert, 'gclient')
    self.mox.StubOutWithMock(revert, 'gclient_scm')

    # These functions are not tested.
    self.mox.StubOutWithMock(revert, 'GetRepoBase')
    self.mox.StubOutWithMock(revert, 'CaptureSVNLog')
Beispiel #3
0
    def setUp(self):
        SuperMoxTestBase.setUp(self)
        self.mox.StubOutWithMock(revert, 'gcl')
        self.mox.StubOutWithMock(revert, 'gclient')
        self.mox.StubOutWithMock(revert, 'gclient_scm')

        # These functions are not tested.
        self.mox.StubOutWithMock(revert, 'GetRepoBase')
        self.mox.StubOutWithMock(revert, 'CaptureSVNLog')
Beispiel #4
0
 def setUp(self):
     SuperMoxTestBase.setUp(self)
     self.fake_root_dir = self.RootDir()
     self.mox.StubOutWithMock(gcl, 'RunShell')
     self.mox.StubOutWithMock(gcl.SVN, 'CaptureInfo')
     self.mox.StubOutWithMock(gcl, 'tempfile')
     self.mox.StubOutWithMock(gcl.upload, 'RealMain')
     # These are not tested.
     self.mox.StubOutWithMock(gcl, 'ReadFile')
     self.mox.StubOutWithMock(gcl, 'WriteFile')
Beispiel #5
0
 def setUp(self):
   SuperMoxTestBase.setUp(self)
   self.fake_root = '/fake_root'
   self.expected_files = ['foo.txt', 'bar.txt']
   change_info = trychange.gcl.ChangeInfo(
       'test_change', 0, 0, 'desc',
       [('M', f) for f in self.expected_files],
       self.fake_root)
   self.svn = trychange.SVN(None)
   self.svn.change_info = change_info
Beispiel #6
0
 def setUp(self):
   SuperMoxTestBase.setUp(self)
   self.fake_root_dir = self.RootDir()
   self.mox.StubOutWithMock(gcl, 'RunShell')
   self.mox.StubOutWithMock(gcl.SVN, 'CaptureInfo')
   self.mox.StubOutWithMock(gcl, 'tempfile')
   self.mox.StubOutWithMock(gcl.upload, 'RealMain')
   # These are not tested.
   self.mox.StubOutWithMock(gcl, 'ReadFile')
   self.mox.StubOutWithMock(gcl, 'WriteFile')
 def setUp(self):
   SuperMoxTestBase.setUp(self)
   self.fake_root_dir = self.RootDir()
   self.mox.StubOutWithMock(gcl, 'RunShell')
   self.mox.StubOutWithMock(gcl.SVN, 'CaptureInfo')
   self.mox.StubOutWithMock(gcl.SVN, 'GetCheckoutRoot')
   self.mox.StubOutWithMock(gcl, 'tempfile')
   self.mox.StubOutWithMock(gcl.upload, 'RealMain')
   self.mox.StubOutWithMock(gcl.gclient_utils, 'FileRead')
   self.mox.StubOutWithMock(gcl.gclient_utils, 'FileWrite')
   gcl.REPOSITORY_ROOT = None
   self.old_review_settings = gcl.CODEREVIEW_SETTINGS
   self.assertEquals(gcl.CODEREVIEW_SETTINGS, {})
 def setUp(self):
     SuperMoxTestBase.setUp(self)
     self.fake_root_dir = self.RootDir()
     self.mox.StubOutWithMock(gcl, 'RunShell')
     self.mox.StubOutWithMock(gcl.SVN, 'CaptureInfo')
     self.mox.StubOutWithMock(gcl.SVN, 'GetCheckoutRoot')
     self.mox.StubOutWithMock(gcl, 'tempfile')
     self.mox.StubOutWithMock(gcl.upload, 'RealMain')
     self.mox.StubOutWithMock(gcl.gclient_utils, 'FileRead')
     self.mox.StubOutWithMock(gcl.gclient_utils, 'FileWrite')
     gcl.REPOSITORY_ROOT = None
     self.old_review_settings = gcl.CODEREVIEW_SETTINGS
     self.assertEquals(gcl.CODEREVIEW_SETTINGS, {})
Beispiel #9
0
 def setUp(self):
   SuperMoxTestBase.setUp(self)
   self.mox.StubOutWithMock(gclient_scm.gclient_utils, 'CheckCallAndFilter')
   self.mox.StubOutWithMock(gclient_scm.gclient_utils,
       'CheckCallAndFilterAndHeader')
   self.mox.StubOutWithMock(gclient_scm.gclient_utils, 'FileRead')
   self.mox.StubOutWithMock(gclient_scm.gclient_utils, 'FileWrite')
   self.mox.StubOutWithMock(gclient_scm.gclient_utils, 'RemoveDirectory')
   self._CaptureSVNInfo = gclient_scm.scm.SVN.CaptureInfo
   self.mox.StubOutWithMock(gclient_scm.scm.SVN, 'Capture')
   self.mox.StubOutWithMock(gclient_scm.scm.SVN, 'CaptureInfo')
   self.mox.StubOutWithMock(gclient_scm.scm.SVN, 'CaptureStatus')
   self.mox.StubOutWithMock(gclient_scm.scm.SVN, 'RunAndGetFileList')
   self.mox.StubOutWithMock(subprocess2, 'communicate')
   self.mox.StubOutWithMock(subprocess2, 'Popen')
   self._scm_wrapper = gclient_scm.CreateSCM
   gclient_scm.scm.SVN.current_version = None
   # Absolute path of the fake checkout directory.
   self.base_path = join(self.root_dir, self.relpath)
Beispiel #10
0
 def setUp(self):
   SuperMoxTestBase.setUp(self)
   self.mox.StubOutWithMock(subprocess2, 'communicate')
   self.mox.StubOutWithMock(trychange.scm.GIT, 'Capture')
   self.mox.StubOutWithMock(trychange.scm.GIT, 'GenerateDiff')
   self.mox.StubOutWithMock(trychange.scm.GIT, 'GetCheckoutRoot')
   self.mox.StubOutWithMock(trychange.scm.GIT, 'GetEmail')
   self.mox.StubOutWithMock(trychange.scm.GIT, 'GetPatchName')
   self.mox.StubOutWithMock(trychange.scm.GIT, 'GetUpstreamBranch')
   self.mox.StubOutWithMock(trychange.scm.SVN, 'DiffItem')
   self.mox.StubOutWithMock(trychange.scm.SVN, 'GenerateDiff')
   self.mox.StubOutWithMock(trychange.scm.SVN, 'GetCheckoutRoot')
   self.mox.StubOutWithMock(trychange.scm.SVN, 'GetEmail')
   self.fake_root = self.Dir()
   self.expected_files = ['foo.txt', 'bar.txt']
   self.options = trychange.optparse.Values()
   self.options.files = self.expected_files
   self.options.diff = None
   self.options.name = None
   self.options.email = None
   self.options.exclude = []
Beispiel #11
0
 def tearDown(self):
   SuperMoxTestBase.tearDown(self)