def test_nonoverlapping_filth(self): """can't merge non-overlapping filth""" a_filth = Filth(beg=0, end=3, text="the") b_filth = Filth(beg=4, end=7, text="end") with self.assertRaises(FilthMergeError): a_filth.merge(b_filth) with self.assertRaises(FilthMergeError): b_filth.merge(a_filth)
def test_invalid_merge_documents(self): """Ensure Filth in two different documents cant be merged""" filth_a = Filth(0, 2, text='aa', document_name='one') filth_b = Filth(1, 2, text='a', document_name='two') with self.assertRaises(FilthMergeError): filth_a.merge(filth_b) with self.assertRaises(FilthMergeError): filth_b.merge(filth_a)