• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python fixtures.loop函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tests.fixtures.loop函数的典型用法代码示例。如果您正苦于以下问题:Python loop函数的具体用法?Python loop怎么用?Python loop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了loop函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_elapsed

 def test_elapsed(self):
     p.now = 100
     p.switches["shooter_lane"].activate()
     fixtures.loop()
     p.now = 150
     fixtures.loop()
     self.assertEquals(50, p.switches["shooter_lane"].elapsed())
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:7,代码来源:test_devices.py


示例2: test_game_start

 def test_game_start(self):
     p.data["credits"] = 2
     p.data["simulator_enabled"] = True
     p.switches["start_button"].toggle()
     p.switches["start_button"].toggle()
     fixtures.loop()
     self.assertEquals("enable", p.lamps["start_button"].state["schedule"])
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:7,代码来源:test_coin.py


示例3: test_no_auto_launch

 def test_no_auto_launch(self):
     with patch.object(self.mode, "eject") as launch:
         p.switches["shooter_lane"].activate()
         fixtures.loop()
         p.now = 1
         fixtures.loop()
         self.assertFalse(launch.called)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:7,代码来源:test_plunger.py


示例4: test_already_up

 def test_already_up(self):
     listener = Mock()
     p.events.on("coil_drop_target_up", listener)
     p.now = 100
     self.mode.up()
     fixtures.loop()
     self.assertFalse(listener.called)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:7,代码来源:test_drop_target.py


示例5: test_shooter_lane_inactive

 def test_shooter_lane_inactive(self):
     p.switches["shooter_lane"].activate()
     fixtures.loop()
     p.switches["shooter_lane"].deactivate()
     fixtures.loop()
     self.assertEquals("disable",
             p.lamps["ball_launch_button"].state["schedule"])
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:7,代码来源:test_plunger.py


示例6: test_down_on_hit

 def test_down_on_hit(self):
     listener = Mock()
     p.events.on("coil_drop_target_down", listener)
     p.switches["drop_target"].activate()
     self.mode.down()
     fixtures.loop()
     self.assertTrue(listener.called)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:7,代码来源:test_drop_target.py


示例7: test_stop

 def test_stop(self):
     p.data["simulator_enabled"] = False
     fixtures.loop()
     self.assertFalse(p.switches["trough"].active)
     self.assertFalse(p.switches["trough_2"].active)
     self.assertFalse(p.switches["trough_3"].active)
     self.assertFalse(p.switches["popper"].active)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:7,代码来源:test_simulator.py


示例8: test_no_notice

 def test_no_notice(self, mock_publish, mock_start):
     p.data["server_publish_events"] = False
     self.ws.done = Mock()
     self.ws.run()
     p.events.post("notice", "foo", "bar")
     fixtures.loop()
     self.assertFalse(mock_publish.called)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:7,代码来源:test_server.py


示例9: test_toggle

 def test_toggle(self, mock_server, mock_exit):
     p.data["server_enabled"] = True
     fixtures.loop()
     self.assertTrue(self.mode.enabled)
     p.data["server_enabled"] = False
     fixtures.loop()
     self.assertFalse(self.mode.enabled)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:7,代码来源:test_server.py


示例10: test_no_free_balls

 def test_no_free_balls(self):
     p.switches["trough_4"].activate()
     fixtures.loop()
     p.switches["trough_4"].deactivate()
     fixtures.loop()
     self.assertTrue(p.switches["trough_3"].active)
     self.assertFalse(p.switches["trough_4"].active)
     self.assertEquals(0, self.sim.free)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:8,代码来源:test_simulator.py


示例11: test_user_switch

    def test_user_switch(self):
        listen = Mock()
        p.events.on("drain", listen)

        p.events.post("playfield_enable")
        p.switches["service_enter"].activate()
        fixtures.loop()
        self.assertFalse(listen.called)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:8,代码来源:test_shots.py


示例12: test_no_dispatch_switch

 def test_no_dispatch_switch(self, mock_publish, mock_start):
     p.data["server_publish_events"] = False
     self.ws.done = Mock()
     self.ws.run()
     switch = p.switches["start_button"]
     switch.activate()
     fixtures.loop()
     self.assertFalse(mock_publish.called)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:8,代码来源:test_server.py


示例13: test_game_end

 def test_game_end(self):
     fixtures.launch()
     self.assertTrue(p.modes["flippers"].enabled)
     p.now += 3 * 60.0
     fixtures.loop()
     self.assertFalse(p.modes["flippers"].enabled)
     fixtures.drain()
     self.assertFalse(p.game)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:8,代码来源:test_practice.py


示例14: test_no_attract

 def test_no_attract(self):
     p.data["credits"] = 1.0
     p.modes["attract"].disable()
     p.data["simulator_enabled"] = True
     p.switches["start_button"].activate()
     fixtures.loop()
     self.assertFalse(p.modes["attract"].enabled)
     self.assertFalse(p.modes["game_menu"].enabled)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:8,代码来源:test_coin.py


示例15: test_enable

 def test_enable(self):
     switch = p.switches["drop_target"]
     switch.deactivate()
     fixtures.loop()
     self.assertFalse(switch.active)
     p.coils["drop_target_down"].pulse()
     fixtures.loop()
     self.assertTrue(switch.active)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:8,代码来源:test_simulator.py


示例16: test_saucer_disable_magnets

 def test_saucer_disable_magnets(self):
     fixtures.launch()
     #p.switches["ball_launch_button"].activate()
     #fixtures.loop()
     p.switches["saucer"].activate()
     fixtures.loop("saucer")
     p.now += 1.0
     fixtures.loop("saucer_eject")
     self.assertFalse(self.mode.magnets)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:9,代码来源:test_practice.py


示例17: test_popper

 def test_popper(self):
     listener = Mock()
     p.events.on("coil_popper", listener)
     fixtures.launch()
     p.events.post("switch_subway_center")
     fixtures.loop()
     p.now += 1
     fixtures.loop()
     self.assertTrue(listener.called)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:9,代码来源:test_practice.py


示例18: test_drop_target_up

 def test_drop_target_up(self):
     p.modes["drop_target"].down()
     fixtures.loop()
     fixtures.launch()
     listener = Mock()
     p.events.on("coil_drop_target_up", listener)
     p.switches["subway_left"].activate()
     fixtures.loop()
     self.assertTrue(listener.called)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:9,代码来源:test_practice.py


示例19: test_launch_after_drain

 def test_launch_after_drain(self):
     fixtures.launch()
     listener = Mock()
     p.events.on("coil_auto_plunger", listener)
     p.switches["trough_4"].activate()
     fixtures.loop()
     p.now += 1
     fixtures.loop()
     self.assertTrue(listener.called)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:9,代码来源:test_practice.py


示例20: test_eject

 def test_eject(self):
     listener = Mock()
     p.events.on("trough_ejected", listener)
     self.trough.eject()
     p.switches["shooter_lane"].activate()
     fixtures.loop()
     p.now = 0.5
     fixtures.loop()
     self.assertTrue(listener.called)
开发者ID:town-hall-pinball,项目名称:project-omega,代码行数:9,代码来源:test_trough.py



注:本文中的tests.fixtures.loop函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python fixtures.DomainFactory类代码示例发布时间:2022-05-27
下一篇:
Python fixtures.get函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap