本文整理汇总了Python中mockito.inorder.verify函数的典型用法代码示例。如果您正苦于以下问题:Python verify函数的具体用法?Python verify怎么用?Python verify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了verify函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_schedules_job_with_one_child_one_parent
def test_schedules_job_with_one_child_one_parent(self):
self.workflow_file_content = "JOB A ls ssh://host/dir\n"
self.workflow_file_content += "JOB B rm ssh://host/file\n"
self.workflow_file_content += "PARENT B CHILD A"
self.run_workflow()
inorder.verify(self.filesystem).remove(["ssh://host/file"])
inorder.verify(self.filesystem).list_dir("ssh://host/dir")
开发者ID:mdlugajczyk,项目名称:computing-infrastructure-assignment,代码行数:7,代码来源:workflow_runner_test.py
示例2: test_update_draft
def test_update_draft(self):
mail = InputMail.from_dict(test_helper.mail_dict())
when(self.mail_store).add_mail("DRAFTS", mail.raw).thenReturn(defer.succeed(LeapMail("id", "DRAFTS")))
self.draft_service.update_draft(mail.ident, mail)
inorder.verify(self.mail_store).add_mail("DRAFTS", mail.raw)
inorder.verify(self.mail_store).delete_mail(mail.ident)
开发者ID:rdoh,项目名称:pixelated-user-agent,代码行数:8,代码来源:test_draft_service.py
示例3: test_update_draft
def test_update_draft(self):
mail = InputMail.from_dict(test_helper.mail_dict())
when(self.drafts_mailbox).add(mail).thenReturn(mail)
self.draft_service.update_draft(mail.ident, mail)
inorder.verify(self.drafts_mailbox).add(mail)
inorder.verify(self.drafts_mailbox).remove(mail.ident)
开发者ID:EderRoger,项目名称:pixelated-user-agent,代码行数:8,代码来源:test_draft_service.py
示例4: test_canAddCommentsToStoryTicket
def test_canAddCommentsToStoryTicket(self):
tracker = self.makeValidTracker()
trackerInstance = self.trackerInstance_
testing = Testing()
item = self.itemWithComments(testing)
tracker.updateCommentsFor(item)
inorder.verify(trackerInstance).AddComment(testing.issue.GetStoryId(), testing.comment1.text())
inorder.verify(trackerInstance).AddComment(testing.issue.GetStoryId(), testing.comment2.text())
pass
开发者ID:lwoydziak,项目名称:pivotal-tracker-syncing,代码行数:9,代码来源:pivotaltracker_test.py
示例5: testPassesMixedVerifications
def testPassesMixedVerifications(self):
self.mock.first()
self.mock.second()
verify(self.mock).first()
verify(self.mock).second()
inorder.verify(self.mock).first()
inorder.verify(self.mock).second()
开发者ID:nyeddi,项目名称:pybuilder_proj,代码行数:9,代码来源:verifications_test.py
示例6: test_update_draft
def test_update_draft(self):
mail = InputMail.from_dict(test_helper.mail_dict(), from_address='[email protected]')
when(self.mail_store).delete_mail(mail.ident).thenReturn(defer.succeed(True))
when(self.mail_store).add_mail('DRAFTS', mail.raw).thenReturn(defer.succeed(LeapMail('id', 'DRAFTS')))
self.draft_service.update_draft(mail.ident, mail)
inorder.verify(self.mail_store).delete_mail(mail.ident)
inorder.verify(self.mail_store).add_mail('DRAFTS', mail.raw)
开发者ID:pixelated,项目名称:pixelated-user-agent,代码行数:9,代码来源:test_draft_service.py
示例7: test_whenSeedingWithRemoteStatusForJira
def test_whenSeedingWithRemoteStatusForJira(self):
ticket = JiraTicket()
statusId = "1234"
closed = "Closed"
ticket.setStatus(statusId)
mapObject = mock()
when(mapObject).translateStatusTo('jiraStatusName', statusId).thenReturn([closed])
status = TrackerItemStatus(ticket, apiObject=mapObject)
status.pivotal()
inorder.verify(mapObject).translateStatusTo('jiraStatusName', statusId)
inorder.verify(mapObject).translateStatusTo('pivotal', closed)
self.assertEqual(status.jira(), [closed])
开发者ID:lwoydziak,项目名称:pivotal-tracker-syncing,代码行数:12,代码来源:trackeritemstatus_test.py
示例8: test_secure_with_mycnf_error
def test_secure_with_mycnf_error(self):
mock_conn = mock_sql_connection()
when(mock_conn).execute(any()).thenReturn(None)
when(utils).execute_with_timeout("sudo", any(str), "stop").thenReturn(None)
# skip writing the file for now
when(os.path).isfile(any()).thenReturn(False)
mock_status = mock()
when(mock_status).wait_for_real_status_to_change_to(any(), any(), any()).thenReturn(True)
app = MySqlApp(mock_status)
self.assertRaises(TypeError, app.secure, None)
verify(mock_conn, atleast=2).execute(any())
inorder.verify(mock_status).wait_for_real_status_to_change_to(
rd_instance.ServiceStatuses.SHUTDOWN, any(), any()
)
verifyNoMoreInteractions(mock_status)
开发者ID:ReVolly,项目名称:trove,代码行数:17,代码来源:test_dbaas.py
示例9: test_set_data_watcher
def test_set_data_watcher(self):
watcher = mock()
z = pookeeper.allocate(self.hosts)
z.create('/pookie', CREATOR_ALL_ACL, Ephemeral(), data=_random_data())
stat = z.exists('/pookie')
stat = z.set_data('/pookie', _random_data(), stat.version)
z.get_data('/pookie', watcher=watcher)
stat = z.set_data('/pookie', _random_data(), stat.version)
z.get_data('/pookie', watcher=watcher)
z.delete('/pookie', stat.version)
z.close()
inorder.verify(watcher).data_changed('/pookie')
inorder.verify(watcher).node_deleted('/pookie')
verifyNoMoreInteractions(watcher)
开发者ID:maguro,项目名称:pookeeper,代码行数:18,代码来源:test_client.py
示例10: testFailsMixedVerifications
def testFailsMixedVerifications(self):
self.mock.second()
self.mock.first()
# first - normal verifications, they should pass
verify(self.mock).first()
verify(self.mock).second()
# but, inorder verification should fail
self.assertRaises(VerificationError, inorder.verify(self.mock).first)
开发者ID:nyeddi,项目名称:pybuilder_proj,代码行数:10,代码来源:verifications_test.py
示例11: test_schedules_job_with_two_children
def test_schedules_job_with_two_children(self):
self.workflow_file_content = "JOB A ls ssh://host/dir\n"
self.workflow_file_content += "JOB B rm ssh://host/file\n"
self.workflow_file_content += "JOB C ls ssh://host/dir2\n"
self.workflow_file_content += "JOB D cat ssh://host/file2\n"
self.workflow_file_content += "PARENT B D CHILD A C\n"
self.workflow_file_content += "PARENT B CHILD D \n"
self.workflow_file_content += "PARENT A CHILD C\n"
self.run_workflow()
inorder.verify(self.filesystem).remove(["ssh://host/file"])
inorder.verify(self.filesystem).cat(["ssh://host/file2"])
inorder.verify(self.filesystem).list_dir("ssh://host/dir")
inorder.verify(self.filesystem).list_dir("ssh://host/dir2")
开发者ID:mdlugajczyk,项目名称:computing-infrastructure-assignment,代码行数:13,代码来源:workflow_runner_test.py
示例12: test_exists_default_watcher
def test_exists_default_watcher(self):
watcher = mock()
z = pookeeper.allocate(self.hosts, watcher=watcher)
assert not z.exists('/pookie', watch=True)
z.create('/pookie', CREATOR_ALL_ACL, Ephemeral(), data=_random_data())
stat = z.exists('/pookie', watch=True)
stat = z.set_data('/pookie', _random_data(), stat.version)
# This data change will be ignored since the watch has been reset
z.set_data('/pookie', _random_data(), stat.version)
stat = z.exists('/pookie', watch=True)
z.delete('/pookie', stat.version)
z.close()
inorder.verify(watcher).session_connected(matchers.any(long), matchers.any(str), False)
inorder.verify(watcher).node_created('/pookie')
inorder.verify(watcher).data_changed('/pookie')
inorder.verify(watcher).node_deleted('/pookie')
inorder.verify(watcher).connection_closed()
verifyNoMoreInteractions(watcher)
开发者ID:maguro,项目名称:pookeeper,代码行数:22,代码来源:test_client.py
示例13: testPassesIfMultipleInteractions
def testPassesIfMultipleInteractions(self):
self.mock.first()
self.mock.second()
self.mock.third()
inorder.verify(self.mock).first()
inorder.verify(self.mock).second()
inorder.verify(self.mock).third()
开发者ID:nyeddi,项目名称:pybuilder_proj,代码行数:8,代码来源:verifications_test.py
示例14: test_print_statement_containing_all_transactions
def test_print_statement_containing_all_transactions(self):
console = mock()
clock = mock()
when(clock).date_as_string().thenReturn('01/04/2015').thenReturn('02/04/2015').thenReturn('10/04/2015')
account = Account(TransactionRepository(clock), StatementPrinter(console))
account.deposit(1000)
account.withdraw(100)
account.deposit(500)
account.print_statement()
inorder.verify(console).print_line('DATE | AMOUNT | BALANCE')
inorder.verify(console).print_line('10/04/2015 | 500.00 | 1400.00')
inorder.verify(console).print_line('02/04/2015 | -100.00 | 900.00')
inorder.verify(console).print_line('01/04/2015 | 1000.00 | 1000.00')
开发者ID:agualis,项目名称:python_mockist_bank_kata,代码行数:17,代码来源:print_statement_feature.py
示例15: test_canAddCommentsToTicket
def test_canAddCommentsToTicket(self):
jira = JiraTracker()
jiraInstance = self.getMockFor(jira)
testing = Testing()
item = self.itemWithComments(testing)
jira.updateCommentsFor(item)
inorder.verify(jiraInstance.service).login(any(),any())
inorder.verify(jiraInstance.service).addComment(self.auth_, testing.issue.key, {"body":testing.comment1.text()})
inorder.verify(jiraInstance.service).addComment(self.auth_, testing.issue.key, {"body":testing.comment2.text()})
pass
开发者ID:lwoydziak,项目名称:pivotal-tracker-syncing,代码行数:10,代码来源:jiratracker_test.py
示例16: test_canGetCommentsForTicket
def test_canGetCommentsForTicket(self):
jira = JiraTracker()
jiraInstance = self.getMockFor(jira)
ticket = mock()
key = "12345"
twoComments = [RemoteComment("comment0"), RemoteComment("comment1")]
when(ticket).Id().thenReturn(key)
when(jiraInstance.service).getComments(any(),any()).thenReturn(twoComments)
jira.addCommentsTo(ticket)
verify(jiraInstance.service).getComments(self.auth_, key)
inorder.verify(ticket).Id()
inorder.verify(ticket).addComment(JiraComment(twoComments[0]), 'existing')
inorder.verify(ticket).addComment(JiraComment(twoComments[1]), 'existing')
pass
开发者ID:lwoydziak,项目名称:pivotal-tracker-syncing,代码行数:14,代码来源:jiratracker_test.py
示例17: test_gettingItemAlsoGetsCommentsForItem
def test_gettingItemAlsoGetsCommentsForItem(self):
tracker = self.makeValidTracker()
trackerInstance = self.trackerInstance_
story1 = Story()
story1.story_id = 1234
story2 = Story()
story2.story_id = 1235
when(trackerInstance).GetStories(any()).thenReturn([story1,story2])
when(trackerInstance).GetComments(any()).thenReturn([])
itemIterator = tracker.items()
next(itemIterator)
next(itemIterator)
inorder.verify(trackerInstance).GetStories(any())
inorder.verify(trackerInstance).GetComments(story1.GetStoryId())
inorder.verify(trackerInstance).GetComments(story2.GetStoryId())
开发者ID:lwoydziak,项目名称:pivotal-tracker-syncing,代码行数:15,代码来源:pivotaltracker_test.py
示例18: test_canAddNewItemNotInTrackerAndwhenAddingUpdateItemBeforeUpdatingDetails
def test_canAddNewItemNotInTrackerAndwhenAddingUpdateItemBeforeUpdatingDetails(self):
toTracker = mock()
fromTracker = mock()
itemToBeAdded = mock()
detectedItem = mock()
itemWithDetails = mock()
TrackerItemType = mock()
when(fromTracker).items(any()).thenReturn([detectedItem])
when(toTracker).items(any()).thenReturn([])
when(TrackerItemType).called().thenReturn(itemToBeAdded)
when(toTracker).update(itemToBeAdded).thenReturn(itemWithDetails)
syncByAddingItems = TrackerSyncBy.addingItemsOfType(TrackerItemType.called)
syncByAddingItems(fromTracker, toTracker)
inorder.verify(toTracker).items(any())
inorder.verify(toTracker).update(itemToBeAdded)
inorder.verify(toTracker).update(itemWithDetails)
开发者ID:lwoydziak,项目名称:pivotal-tracker-syncing,代码行数:16,代码来源:trackersyncby_test.py
示例19: test_load_should_delegate_to_registered_providers
def test_load_should_delegate_to_registered_providers(self):
s_symbol = ""
providerMock1 = mock(AbstractProvider)
providerMock2 = mock(AbstractProvider)
providerMock3 = mock(AbstractProvider)
when(providerMock1).load(s_symbol).thenReturn(None)
when(providerMock2).load(s_symbol).thenReturn(None)
when(providerMock3).load(s_symbol).thenReturn(None)
provider = Provider(providerMock1, providerMock2, providerMock3)
provider.load(s_symbol)
inorder.verify(providerMock1, times=1).load(s_symbol)
inorder.verify(providerMock2, times=1).load(s_symbol)
inorder.verify(providerMock3, times=1).load(s_symbol)
开发者ID:laurocaetano,项目名称:stockExperiments,代码行数:16,代码来源:base_tests.py
示例20: test_load_should_delegate_sequentially_till_one_returns_data
def test_load_should_delegate_sequentially_till_one_returns_data(self):
s_symbol = ""
l_data = ["Sample data"]
providerMock1 = mock(AbstractProvider)
providerMock2 = mock(AbstractProvider)
providerMock3 = mock(AbstractProvider)
when(providerMock1).load(s_symbol).thenReturn(None)
when(providerMock2).load(s_symbol).thenReturn(l_data)
when(providerMock3).load(s_symbol).thenReturn(None)
provider = Provider(providerMock1, providerMock2, providerMock3)
result = provider.load(s_symbol)
assert result == l_data
inorder.verify(providerMock1, times=1).load(s_symbol)
inorder.verify(providerMock2, times=1).load(s_symbol)
inorder.verify(providerMock3, times=0).load(s_symbol)
开发者ID:laurocaetano,项目名称:stockExperiments,代码行数:18,代码来源:base_tests.py
注:本文中的mockito.inorder.verify函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论