本文整理汇总了Python中testing_support.super_mox.SuperMoxTestBase类的典型用法代码示例。如果您正苦于以下问题:Python SuperMoxTestBase类的具体用法?Python SuperMoxTestBase怎么用?Python SuperMoxTestBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SuperMoxTestBase类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
SuperMoxTestBase.setUp(self)
self.fake_file_name = 'fake.css'
self.fake_file = self.mox.CreateMockAnything()
self.mox.StubOutWithMock(self.fake_file, 'LocalPath')
self.fake_file.LocalPath().AndReturn(self.fake_file_name)
# Actual calls to NewContents() are defined in each test.
self.mox.StubOutWithMock(self.fake_file, 'NewContents')
self.input_api = self.mox.CreateMockAnything()
self.input_api.re = re
self.mox.StubOutWithMock(self.input_api, 'AffectedSourceFiles')
self.input_api.AffectedFiles(
include_deletes=False, file_filter=None).AndReturn([self.fake_file])
# Actual creations of PresubmitPromptWarning are defined in each test.
self.output_api = self.mox.CreateMockAnything()
self.mox.StubOutWithMock(self.output_api, 'PresubmitPromptWarning',
use_mock_anything=True)
author_msg = ('Was the CSS checker useful? '
'Send feedback or hate mail to [email protected]')
self.output_api = self.mox.CreateMockAnything()
self.mox.StubOutWithMock(self.output_api, 'PresubmitNotifyResult',
use_mock_anything=True)
self.output_api.PresubmitNotifyResult(author_msg).AndReturn(None)
开发者ID:aducode,项目名称:chromium,代码行数:28,代码来源:test_presubmit.py
示例2: setUp
def setUp(self):
SuperMoxTestBase.setUp(self)
input_api = self.mox.CreateMockAnything()
input_api.re = re
output_api = self.mox.CreateMockAnything()
self.checker = resource_checker.ResourceChecker(input_api, output_api)
开发者ID:AlinaGlavan,项目名称:chromium,代码行数:7,代码来源:resource_checker_test.py
示例3: setUp
def setUp(self):
SuperMoxTestBase.setUp(self)
self.fake_file_name = 'fake.css'
self.fake_file = self.mox.CreateMockAnything()
self.mox.StubOutWithMock(self.fake_file, 'LocalPath')
self.fake_file.LocalPath().AndReturn(self.fake_file_name)
# Actual calls to NewContents() are defined in each test.
self.mox.StubOutWithMock(self.fake_file, 'NewContents')
self.input_api = self.mox.CreateMockAnything()
self.input_api.re = re
self.mox.StubOutWithMock(self.input_api, 'AffectedSourceFiles')
self.input_api.AffectedFiles(
include_deletes=False, file_filter=None).AndReturn([self.fake_file])
# Actual creations of PresubmitPromptWarning are defined in each test.
self.output_api = self.mox.CreateMockAnything()
self.mox.StubOutWithMock(self.output_api, 'PresubmitPromptWarning',
use_mock_anything=True)
self.output_api = self.mox.CreateMockAnything()
self.mox.StubOutWithMock(self.output_api, 'PresubmitNotifyResult',
use_mock_anything=True)
开发者ID:mic101,项目名称:chromium-crosswalk,代码行数:25,代码来源:test_presubmit.py
示例4: setUp
def setUp(self):
SuperMoxTestBase.setUp(self)
self.mox.StubOutWithMock(auto_roll.rietveld.Rietveld, 'add_comment')
self.mox.StubOutWithMock(auto_roll.rietveld.Rietveld, 'close_issue')
self.mox.StubOutWithMock(auto_roll.rietveld.Rietveld,
'get_issue_properties')
self.mox.StubOutWithMock(auto_roll.rietveld.Rietveld, 'search')
self.mox.StubOutWithMock(auto_roll.scm.GIT, 'Capture')
self.mox.StubOutWithMock(auto_roll.subprocess2, 'check_call')
self.mox.StubOutWithMock(auto_roll.subprocess2, 'check_output')
self.mox.StubOutWithMock(auto_roll.urllib2, 'urlopen')
auto_roll.datetime.datetime = self.MockDateTime
auto_roll.rietveld.upload.HttpRpcServer = self.MockHttpRpcServer
self._arb = auto_roll.AutoRoller(self.TEST_PROJECT,
self.TEST_AUTHOR,
self.PATH_TO_CHROME)
开发者ID:leiferikb,项目名称:bitpop,代码行数:16,代码来源:auto_roll_test.py
示例5: setUp
def setUp(self):
SuperMoxTestBase.setUp(self)
input_api = self.mox.CreateMockAnything()
input_api.os_path = os_path
input_api.re = re
input_api.change = self.mox.CreateMockAnything()
self.mox.StubOutWithMock(input_api.change, 'RepositoryRoot')
src_root = os_path.join(os_path.dirname(__file__), '..', '..', '..')
input_api.change.RepositoryRoot().MultipleTimes().AndReturn(src_root)
output_api = self.mox.CreateMockAnything()
self.mox.ReplayAll()
self.checker = js_checker.JSChecker(input_api, output_api)
开发者ID:AlinaGlavan,项目名称:chromium,代码行数:17,代码来源:closure_lint_test.py
示例6: setUp
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.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)
开发者ID:DerinoGamer,项目名称:dotfiles,代码行数:18,代码来源:gclient_scm_test.py
示例7: setUp
def setUp(self):
SuperMoxTestBase.setUp(self)
self.mox.StubOutWithMock(subprocess2, 'communicate')
self.mox.StubOutWithMock(trychange, 'RunGit')
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, '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 = []
开发者ID:173210,项目名称:depot_tools,代码行数:21,代码来源:trychange_unittest.py
示例8: setUp
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.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
self._original_SVNBinaryExists = gclient_scm.SVNWrapper.BinaryExists
self._original_GitBinaryExists = gclient_scm.GitWrapper.BinaryExists
gclient_scm.SVNWrapper.BinaryExists = staticmethod(lambda: True)
gclient_scm.GitWrapper.BinaryExists = staticmethod(lambda: True)
# Absolute path of the fake checkout directory.
self.base_path = join(self.root_dir, self.relpath)
开发者ID:nevir,项目名称:plexability,代码行数:21,代码来源:gclient_scm_test.py
示例9: setUp
def setUp(self):
SuperMoxTestBase.setUp(self)
self.input_api = self.mox.CreateMockAnything()
self.input_api.re = re
self.input_api.os_path = os.path
开发者ID:VividROM,项目名称:external_chromium_org,代码行数:5,代码来源:copyright_scanner_unittest.py
示例10: tearDown
def tearDown(self):
self.mox.UnsetStubs()
SuperMoxTestBase.tearDown(self)
开发者ID:VividROM,项目名称:external_chromium_org,代码行数:3,代码来源:copyright_scanner_unittest.py
示例11: setUp
def setUp(self):
SuperMoxTestBase.setUp(self)
开发者ID:173210,项目名称:depot_tools,代码行数:2,代码来源:gclient_scm_test.py
示例12: tearDown
def tearDown(self):
SuperMoxTestBase.tearDown(self)
gclient_scm.SVNWrapper.BinaryExists = self._original_SVNBinaryExists
gclient_scm.GitWrapper.BinaryExists = self._original_GitBinaryExists
开发者ID:173210,项目名称:depot_tools,代码行数:4,代码来源:gclient_scm_test.py
示例13: setUp
def setUp(self):
SuperMoxTestBase.setUp(self)
self.input_api = self.mox.CreateMockAnything()
self.input_api.os_path = os.path
self.input_api.change = self.mox.CreateMockAnything()
self.input_api.change.RepositoryRoot = lambda: ''
开发者ID:Crawping,项目名称:chromium_extract,代码行数:6,代码来源:copyright_scanner_unittest.py
注:本文中的testing_support.super_mox.SuperMoxTestBase类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论