本文整理汇总了Python中testing_support.super_mox.SuperMoxTestBase.setUp方法的典型用法代码示例。如果您正苦于以下问题:Python SuperMoxTestBase.setUp方法的具体用法?Python SuperMoxTestBase.setUp怎么用?Python SuperMoxTestBase.setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testing_support.super_mox.SuperMoxTestBase
的用法示例。
在下文中一共展示了SuperMoxTestBase.setUp方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from testing_support.super_mox import SuperMoxTestBase [as 别名]
# 或者: from testing_support.super_mox.SuperMoxTestBase import setUp [as 别名]
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)
示例2: setUp
# 需要导入模块: from testing_support.super_mox import SuperMoxTestBase [as 别名]
# 或者: from testing_support.super_mox.SuperMoxTestBase import setUp [as 别名]
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)
示例3: setUp
# 需要导入模块: from testing_support.super_mox import SuperMoxTestBase [as 别名]
# 或者: from testing_support.super_mox.SuperMoxTestBase import setUp [as 别名]
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)
示例4: setUp
# 需要导入模块: from testing_support.super_mox import SuperMoxTestBase [as 别名]
# 或者: from testing_support.super_mox.SuperMoxTestBase import setUp [as 别名]
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)
示例5: setUp
# 需要导入模块: from testing_support.super_mox import SuperMoxTestBase [as 别名]
# 或者: from testing_support.super_mox.SuperMoxTestBase import setUp [as 别名]
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)
示例6: setUp
# 需要导入模块: from testing_support.super_mox import SuperMoxTestBase [as 别名]
# 或者: from testing_support.super_mox.SuperMoxTestBase import setUp [as 别名]
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)
示例7: setUp
# 需要导入模块: from testing_support.super_mox import SuperMoxTestBase [as 别名]
# 或者: from testing_support.super_mox.SuperMoxTestBase import setUp [as 别名]
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 = []
示例8: setUp
# 需要导入模块: from testing_support.super_mox import SuperMoxTestBase [as 别名]
# 或者: from testing_support.super_mox.SuperMoxTestBase import setUp [as 别名]
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)
示例9: setUp
# 需要导入模块: from testing_support.super_mox import SuperMoxTestBase [as 别名]
# 或者: from testing_support.super_mox.SuperMoxTestBase import setUp [as 别名]
def setUp(self):
SuperMoxTestBase.setUp(self)
self.input_api = self.mox.CreateMockAnything()
self.input_api.re = re
self.input_api.os_path = os.path
示例10: setUp
# 需要导入模块: from testing_support.super_mox import SuperMoxTestBase [as 别名]
# 或者: from testing_support.super_mox.SuperMoxTestBase import setUp [as 别名]
def setUp(self):
SuperMoxTestBase.setUp(self)
示例11: setUp
# 需要导入模块: from testing_support.super_mox import SuperMoxTestBase [as 别名]
# 或者: from testing_support.super_mox.SuperMoxTestBase import setUp [as 别名]
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: ''