Exemple #1
0
    def test_create_with_all_fields(self):
        schedule_model = Schedule(
            name='schedule',
            tenant_uuid=self.default_tenant.uuid,
            timezone='time/zone',
            fallback_action='user',
            fallback_actionid='2',
            fallback_actionargs='10',
            enabled=False,
        )
        schedule = schedule_dao.create(schedule_model)

        self.session.expire_all()
        assert_that(inspect(schedule).persistent)
        assert_that(
            schedule,
            has_properties(
                name='schedule',
                tenant_uuid=self.default_tenant.uuid,
                timezone='time/zone',
                fallback_action='user',
                fallback_actionid='2',
                fallback_actionargs='10',
                enabled=False,
            ))
Exemple #2
0
    def test_create_minimal_fields(self):
        schedule_model = Schedule(tenant_uuid=self.default_tenant.uuid)
        schedule = schedule_dao.create(schedule_model)

        self.session.expire_all()
        assert_that(inspect(schedule).persistent)
        assert_that(
            schedule,
            has_properties(id=is_not(none()),
                           tenant_uuid=self.default_tenant.uuid,
                           name=None,
                           timezone=None,
                           fallback_action='none',
                           type='none',
                           fallback_actionid=None,
                           actionarg1=None,
                           fallback_actionargs=None,
                           actionarg2=None,
                           enabled=True))
Exemple #3
0
 def add_schedule(self, **kwargs):
     kwargs.setdefault('tenant_uuid', self.default_tenant.uuid)
     schedule = Schedule(**kwargs)
     self.add_me(schedule)
     return schedule
Exemple #4
0
 def _insert_schedule(self, name):
     schedule = Schedule()
     schedule.name = name
     self.add_me(schedule)
     return schedule.id
Exemple #5
0
    def test_add(self):
        schedule = Schedule()
        schedule.name = 'test'
        schedule_dao.add(schedule)

        self.assertEquals(schedule, self.session.query(Schedule).first())
Exemple #6
0
 def _insert_schedule(self, name):
     schedule = Schedule()
     schedule.name = name
     self.add_me(schedule)
     return schedule.id
Exemple #7
0
    def test_add(self):
        schedule = Schedule()
        schedule.name = "test"
        schedule_dao.add(schedule)

        self.assertEquals(schedule, self.session.query(Schedule).first())