def test_contains_function(self): from tinyfasta import _FastaRecordComponent component = _FastaRecordComponent() component._content = ">seq101|testing" self.assertTrue(component.contains("seq101")) self.assertTrue(component.contains("testing")) self.assertFalse(component.contains("seq102"))
def test_contains_function_with_regex(self): from tinyfasta import _FastaRecordComponent import re regex_match = re.compile(r">seq1[0-9]{2}\|") regex_no_match = re.compile(r">seq1[0-9]{3}\|") component = _FastaRecordComponent() component._content = ">seq101|testing" self.assertTrue(component.contains(regex_match)) self.assertFalse(component.contains(regex_no_match))
def test_has_contains_function(self): from tinyfasta import _FastaRecordComponent component = _FastaRecordComponent() self.assertTrue(callable(component.contains))
def test_component_initialisation(self): from tinyfasta import _FastaRecordComponent component = _FastaRecordComponent() self.assertTrue(isinstance(component, _FastaRecordComponent))