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


Python event_test_creator.EventTestCreator类代码示例

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


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

示例1: setUp

    def setUp(self):
        self.testbed = testbed.Testbed()
        self.testbed.activate()
        self.testbed.init_datastore_v3_stub()
        self.testbed.init_memcache_stub()
        self.testbed.init_taskqueue_stub(root_path=".")

        self.future_event = EventTestCreator.createFutureEvent(only_event=True)
        self.present_event = EventTestCreator.createPresentEvent(only_event=True)
        self.past_event = EventTestCreator.createPastEvent(only_event=True)
        self.event_starts_today = Event(
            id="{}teststartstoday".format(datetime.datetime.now().year),
            end_date=datetime.datetime.today() + datetime.timedelta(days=2),
            event_short="teststartstoday",
            event_type_enum=EventType.REGIONAL,
            first_eid="5561",
            name="Test Event (Starts Today)",
            start_date=datetime.datetime.today(),
            year=datetime.datetime.now().year,
            venue_address="123 Fake Street, California, USA",
            website="http://www.google.com"
        )
        self.event_ends_today = Event(
            id="{}testendstoday".format(datetime.datetime.now().year),
            end_date=datetime.datetime.today(),
            event_short="testendstoday",
            event_type_enum=EventType.REGIONAL,
            first_eid="5561",
            name="Test Event (Ends Today)",
            start_date=datetime.datetime.today() - datetime.timedelta(days=2),
            year=datetime.datetime.now().year,
            venue_address="123 Fake Street, California, USA",
            website="http://www.google.com"
        )
开发者ID:CarterFendley,项目名称:the-blue-alliance,代码行数:34,代码来源:test_event.py

示例2: setUp

    def setUp(self):
        self.testbed = testbed.Testbed()
        self.testbed.activate()
        self.testbed.init_datastore_v3_stub()
        self.testbed.init_memcache_stub()

        self.future_event = EventTestCreator.createFutureEvent(only_event=True)
        self.present_event = EventTestCreator.createPresentEvent(only_event=True)
        self.past_event = EventTestCreator.createPastEvent(only_event=True)
开发者ID:Captain-Dude,项目名称:the-blue-alliance,代码行数:9,代码来源:test_event.py

示例3: setUp

    def setUp(self):
        self.testbed = testbed.Testbed()
        self.testbed.activate()
        self.testbed.init_datastore_v3_stub()
        self.testbed.init_memcache_stub()
        self.testbed.init_taskqueue_stub(root_path=".")

        for team_number in range(7):
            Team(id="frc%s" % team_number,
                 team_number=team_number).put()

        self.event = EventTestCreator.createPresentEvent()
        self.notification = ScheduleUpdatedNotification(self.event)
开发者ID:BowlesCR,项目名称:the-blue-alliance,代码行数:13,代码来源:test_notification_schedule_updated.py

示例4: setUp

    def setUp(self):
        self.testbed = testbed.Testbed()
        self.testbed.activate()
        self.testbed.init_datastore_v3_stub()
        self.testbed.init_memcache_stub()
        self.testbed.init_taskqueue_stub(root_path=".")

        for team_number in range(7):
            Team(id="frc%s" % team_number,
                 team_number=team_number).put()

        self.event = EventTestCreator.createPresentEvent()
        self.match = self.event.matches[0]
        self.notification = CompLevelStartingNotification(self.match, self.event)
开发者ID:CarterFendley,项目名称:the-blue-alliance,代码行数:14,代码来源:test_notification_level_starting.py

示例5: setUp

    def setUp(self):
        self.testbed = testbed.Testbed()
        self.testbed.activate()
        self.testbed.init_datastore_v3_stub()
        self.testbed.init_memcache_stub()
        ndb.get_context().clear_cache()  # Prevent data from leaking between tests

        self.testbed.init_taskqueue_stub(root_path=".")

        for team_number in range(7):
            Team(id="frc%s" % team_number,
                 team_number=team_number).put()

        self.event = EventTestCreator.createPresentEvent()
        self.notification = AwardsUpdatedNotification(self.event)
开发者ID:ZachOrr,项目名称:the-blue-alliance,代码行数:15,代码来源:test_notification_awards.py

示例6: get

 def get(self):
     if tba_config.CONFIG["env"] != "prod":
         EventTestCreator.createPastEvent()
         EventTestCreator.createFutureEvent()
         EventTestCreator.createPresentEvent()
         self.redirect("/events/")
     else:
         logging.error("{} tried to create test events in prod! No can do.".format(
             users.get_current_user().email()))
         self.redirect("/admin/")
开发者ID:pyprogrammer,项目名称:the-blue-alliance,代码行数:10,代码来源:admin_event_controller.py

示例7: get

    def get(self):
        self._require_admin()

        if tba_config.CONFIG["env"] != "prod":
            EventTestCreator.createPastEvent()
            EventTestCreator.createFutureEvent()
            EventTestCreator.createPresentEvent()
            self.redirect("/events/")
        else:
            logging.error("{} tried to create test events in prod! No can do.".format(
                self.user_bundle.user.email()))
            self.redirect("/admin/")
开发者ID:technonerdz,项目名称:the-blue-alliance,代码行数:12,代码来源:admin_event_controller.py

示例8: test_creates

 def test_creates(self):
     self.events.append(EventTestCreator.createPastEvent())
     self.events.append(EventTestCreator.createFutureEvent())
     self.events.append(EventTestCreator.createPresentEvent())
开发者ID:MC42,项目名称:the-blue-alliance,代码行数:4,代码来源:test_event_test_creator.py

示例9: setUp

    def setUp(self):
        self.testbed = testbed.Testbed()
        self.testbed.activate()
        self.testbed.init_datastore_v3_stub()
        self.testbed.init_memcache_stub()
        ndb.get_context().clear_cache()  # Prevent data from leaking between tests

        self.testbed.init_taskqueue_stub(root_path=".")

        self.future_event = EventTestCreator.createFutureEvent(only_event=True)
        self.present_event = EventTestCreator.createPresentEvent(only_event=True)
        self.past_event = EventTestCreator.createPastEvent(only_event=True)
        self.event_starts_today = Event(
            id="{}teststartstoday".format(datetime.datetime.now().year),
            end_date=datetime.datetime.today() + datetime.timedelta(days=2),
            event_short="teststartstoday",
            event_type_enum=EventType.REGIONAL,
            first_eid="5561",
            name="Test Event (Starts Today)",
            start_date=datetime.datetime.today(),
            year=datetime.datetime.now().year,
            venue_address="123 Fake Street, California, USA",
            website="http://www.google.com"
        )
        self.event_ends_today = Event(
            id="{}testendstoday".format(datetime.datetime.now().year),
            end_date=datetime.datetime.today(),
            event_short="testendstoday",
            event_type_enum=EventType.REGIONAL,
            first_eid="5561",
            name="Test Event (Ends Today)",
            start_date=datetime.datetime.today() - datetime.timedelta(days=2),
            year=datetime.datetime.now().year,
            venue_address="123 Fake Street, California, USA",
            website="http://www.google.com"
        )
        self.event_starts_tomorrow = Event(
            id="{}teststartstomorrow".format(datetime.datetime.now().year),
            end_date=datetime.datetime.today() + datetime.timedelta(days=3),
            event_short="teststartstomorrow",
            event_type_enum=EventType.REGIONAL,
            first_eid="5561",
            name="Test Event (Starts Tomorrow)",
            start_date=datetime.datetime.today() + datetime.timedelta(days=1),
            year=datetime.datetime.now().year,
            venue_address="123 Fake Street, California, USA",
            website="http://www.google.com"
        )
        self.event_starts_tomorrow_tz = Event(
            id="{}teststartstomorrow".format(datetime.datetime.now().year),
            end_date=datetime.datetime.today() + datetime.timedelta(days=3),
            event_short="teststartstomorrow",
            event_type_enum=EventType.REGIONAL,
            first_eid="5561",
            name="Test Event (Starts Tomorrow)",
            start_date=datetime.datetime.today() + datetime.timedelta(days=1),
            year=datetime.datetime.now().year,
            venue_address="123 Fake Street, California, USA",
            website="http://www.google.com",
            timezone_id="America/New_York",
        )
开发者ID:MC42,项目名称:the-blue-alliance,代码行数:61,代码来源:test_event.py


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