예제 #1
0
파일: test_trigger.py 프로젝트: nomed/rnms
 def test_triggerruleds_insert_last(self):
     """ Trigger rules insert_first puts new rows last"""
     first_row = model.TriggerRule()
     second_row = model.TriggerRule()
     self.obj.insert(0, first_row)
     eq_(len(self.obj.rules), 1)
     eq_(first_row.position, 0)
     self.obj.append(second_row)
     eq_(len(self.obj.rules), 2)
     eq_(first_row.position, 0)
     eq_(second_row.position, 1)
예제 #2
0
 def create_triggers(self):
     for trigger in database_data.triggers:
         t = model.Trigger()
         (t.display_name, t.email_owner, t.email_users, t.subject, t.body,
          rules) = trigger
         for rule in rules:
             r = model.TriggerRule()
             (field, r.oper, limits, r.stop, r.and_rule) = rule
             r.set_field(field)
             r.set_limit(limits)
             t.append(r)
         model.DBSession.add(t)
예제 #3
0
파일: test_trigger.py 프로젝트: nomed/rnms
 def test_init_rule_bad_field(self):
     """ TriggerRule init with bad field name raises ValueError """
     new_rule = model.TriggerRule(field='BAD')
예제 #4
0
파일: test_trigger.py 프로젝트: nomed/rnms
 def test_init_rule_field(self):
     """ TriggerRule with field sets field """
     new_rule = model.TriggerRule(field='attribute_name')
     eq_(new_rule.field, 1)