Example #1
0
 def test_success(self):
     assert rewrite_record(
         self.record,
         project=self.event.project,
         groups={self.event.group.id: self.event.group},
         rules={self.rule.id: self.rule},
     ) == Record(self.record.key, Notification(self.event, [self.rule]), self.record.timestamp)
 def test_success(self):
     assert rewrite_record(
         self.record,
         project=self.event.project,
         groups={self.event.group.id: self.event.group},
         rules={self.rule.id: self.rule},
     ) == Record(self.record.key, Notification(self.event, [self.rule]), self.record.timestamp)
 def test_filters_invalid_rules(self):
     assert rewrite_record(
         self.record,
         project=self.event.project,
         groups={self.event.group.id: self.event.group},
         rules={},
     ) == Record(self.record.key, Notification(self.record.value.event, []),
                 self.record.timestamp)
Example #4
0
 def test_without_group(self):
     # If the record can't be associated with a group, it should be returned as None.
     assert (
         rewrite_record(
             self.record, project=self.event.project, groups={}, rules={self.rule.id: self.rule}
         )
         is None
     )
Example #5
0
 def test_filters_invalid_rules(self):
     # If the record can't be associated with a group, it should be returned as None.
     assert rewrite_record(
         self.record,
         project=self.event.project,
         groups={self.event.group.id: self.event.group},
         rules={},
     ) == Record(self.record.key, Notification(self.event, []), self.record.timestamp)
Example #6
0
 def test_without_group(self):
     # If the record can't be associated with a group, it should be returned as None.
     assert rewrite_record(
         self.record,
         project=self.event.project,
         groups={},
         rules={
             self.rule.id: self.rule,
         },
     ) is None
Example #7
0
 def test_filters_invalid_rules(self):
     # If the record can't be associated with a group, it should be returned as None.
     assert rewrite_record(
         self.record,
         project=self.event.project,
         groups={
             self.event.group.id: self.event.group,
         },
         rules={},
     ) == Record(
         self.record.key,
         Notification(self.event, []),
         self.record.timestamp,
     )