当前位置: 首页>>代码示例>>Python>>正文


Python Target.interop_submission方法代码示例

本文整理汇总了Python中auvsi_suas.models.target.Target.interop_submission方法的典型用法代码示例。如果您正苦于以下问题:Python Target.interop_submission方法的具体用法?Python Target.interop_submission怎么用?Python Target.interop_submission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在auvsi_suas.models.target.Target的用法示例。


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

示例1: test_interop_submission

# 需要导入模块: from auvsi_suas.models.target import Target [as 别名]
# 或者: from auvsi_suas.models.target.Target import interop_submission [as 别名]
    def test_interop_submission(self):
        """Tests interop_submission correctly filters submissions."""
        # t1 created and updated before mission time starts.
        t1 = Target(user=self.user, target_type=TargetType.standard)
        t1.save()
        t1.alphanumeric = 'A'
        t1.save()

        # t2 created before mission time starts and updated once it does.
        t2 = Target(user=self.user, target_type=TargetType.standard)
        t2.save()

        # Mission time starts.
        event = MissionClockEvent(user=self.user,
                                  team_on_clock=True,
                                  team_on_timeout=False)
        event.save()

        t2.alphanumeric = 'A'
        t2.save()

        # t3 created and updated during mission time.
        t3 = Target(user=self.user, target_type=TargetType.standard)
        t3.save()
        t3.alphanumeric = 'A'
        t3.save()

        # t4 created in in mission time and updated during timeout.
        t4 = Target(user=self.user, target_type=TargetType.standard)
        t4.save()

        # Team takes timeout. Mission time stops.
        event = MissionClockEvent(user=self.user,
                                  team_on_clock=False,
                                  team_on_timeout=True)
        event.save()

        t4.alphanumeric = 'A'
        t4.save()

        # t5 created and updated during timeout.
        t5 = Target(user=self.user, target_type=TargetType.standard)
        t5.save()
        t5.alphanumeric = 'A'
        t5.save()

        # t6 created and updated once mission time resumes.
        event = MissionClockEvent(user=self.user,
                                  team_on_clock=True,
                                  team_on_timeout=False)
        event.save()
        t6 = Target(user=self.user, target_type=TargetType.standard)
        t6.save()
        t6.alphanumeric = 'A'
        t6.save()
        event = MissionClockEvent(user=self.user,
                                  team_on_clock=False,
                                  team_on_timeout=False)
        event.save()

        self.assertFalse(t1.interop_submission())
        self.assertFalse(t2.interop_submission())
        self.assertTrue(t3.interop_submission())
        self.assertFalse(t4.interop_submission())
        self.assertFalse(t5.interop_submission())
        self.assertTrue(t6.interop_submission())
开发者ID:auvsi-suas,项目名称:interop,代码行数:68,代码来源:target_test.py


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