Esempio n. 1
0
 def setUp(self):
     overlay = 'chromiumos/overlays/chromiumos-overlay'
     self._patch_factory = patch_unittest.MockPatchFactory()
     self.overlay_patch = self._patch_factory.GetPatches(project=overlay)
     chromite = 'chromiumos/chromite'
     self.chromite_patch = self._patch_factory.GetPatches(project=chromite)
     self.power_manager = 'chromiumos/platform2/power_manager'
     self.power_manager_pkg = 'chromeos-base/power_manager'
     self.power_manager_patch = self._patch_factory.GetPatches(
         project=self.power_manager)
     self.kernel = 'chromiumos/third_party/kernel/foo'
     self.kernel_pkg = 'sys-kernel/chromeos-kernel-foo'
     self.kernel_patch = self._patch_factory.GetPatches(project=self.kernel)
     self.secret = 'chromeos/secret'
     self.secret_patch = self._patch_factory.GetPatches(
         project=self.secret, remote=site_config.params.INTERNAL_REMOTE)
     self.PatchObject(cros_patch.GitRepoPatch, 'GetCheckout')
     self.PatchObject(cros_patch.GitRepoPatch, 'GetDiffStatus')
     self.PatchObject(gerrit,
                      'GetGerritPatchInfoWithPatchQueries',
                      side_effect=lambda x: x)
     self.changes = [
         self.overlay_patch, self.chromite_patch, self.power_manager_patch,
         self.kernel_patch, self.secret_patch
     ]
Esempio n. 2
0
 def _GetPatch(self, affected_files):
     p = patch_unittest.MockPatchFactory().MockPatch()
     mock_diff_status = {path: 'M' for path in affected_files}
     self.PatchObject(cros_patch.GerritPatch,
                      'GetDiffStatus',
                      return_value=mock_diff_status)
     return p
Esempio n. 3
0
    def setUp(self):
        self._patch_factory = patch_unittest.MockPatchFactory()
        self.changes = self._patch_factory.GetPatches(how_many=2)

        self._Prepare()

        self.fake_db = fake_cidb.FakeCIDBConnection()
        cidb.CIDBConnectionFactory.SetupMockCidb(self.fake_db)
        build_id = self.fake_db.InsertBuild('test-paladin', 'chromeos', 1,
                                            'test-paladin', 'bot_hostname')
        self._run.attrs.metadata.UpdateWithDict({'build_id': build_id})
Esempio n. 4
0
 def setUp(self):
   self._patch_factory = patch_unittest.MockPatchFactory()
   self.build_root = '/build_root/'
   self.change = self._patch_factory.MockPatch()
   self.checkout = mock.Mock()
   self.common_config_file = '/build_root/repo/COMMIT-QUEUE.ini'
Esempio n. 5
0
 def setUp(self):
     self._patch_factory = patch_unittest.MockPatchFactory()
 def setUp(self):
     self.StartPatcher(parallel_unittest.ParallelMock())
     self._patch_factory = patch_unittest.MockPatchFactory()
     self.build_root = 'fakebuildroot'
     self.GetPatches = self._patch_factory.GetPatches
     self.MockPatch = self._patch_factory.MockPatch
 def setUp(self):
     self.manager = hwtest_results.HWTestResultManager()
     self.db = fake_cidb.FakeCIDBConnection()
     self._patch_factory = patch_unittest.MockPatchFactory()
Esempio n. 8
0
 def setUp(self):
     self._patch_factory = patch_unittest.MockPatchFactory()
     self.GetPatches = self._patch_factory.GetPatches
Esempio n. 9
0
 def setUp(self):
     self.build_root = '/foo/build/root'
     self._patch_factory = patch_unittest.MockPatchFactory()
     self.changes = self._patch_factory.GetPatches(how_many=5)
Esempio n. 10
0
 def setUp(self):
     self.PatchObject(cq_config.CQConfigParser,
                      'GetCommonConfigFileForChange')
     self._patch_factory = patch_unittest.MockPatchFactory()