def test_single(self): for strand in [1, -1]: location = FeatureLocation(6, 9, strand) new = build_location_from_others([location]) assert isinstance(new, FeatureLocation) and not isinstance( new, CompoundLocation) assert new == location
def test_single_compound(self): for strand in [1, -1]: location = CompoundLocation([ FeatureLocation(6, 9, strand), FeatureLocation(12, 16, strand) ]) new = build_location_from_others([location]) assert new == location
def test_all_merged(self): for strand in [1, -1]: locations = [FeatureLocation(6, 9, strand), FeatureLocation(9, 12, strand), FeatureLocation(12, 16, strand)] new = build_location_from_others(locations) assert isinstance(new, FeatureLocation) and not isinstance(new, CompoundLocation) assert new == FeatureLocation(6, 16, strand)
def test_some_merged(self): for strand in [1, -1]: locations = [FeatureLocation(1, 4, strand), FeatureLocation(6, 9, strand), FeatureLocation(9, 12, strand), FeatureLocation(15, 18, strand)] new = build_location_from_others(locations) assert isinstance(new, CompoundLocation) assert new == CompoundLocation([FeatureLocation(1, 4, strand), FeatureLocation(6, 12, strand), FeatureLocation(15, 18, strand)])
def test_separate(self): locations = [FeatureLocation(6, 9, 1), FeatureLocation(12, 16, 1)] new = build_location_from_others(locations) assert isinstance(new, CompoundLocation) assert new == CompoundLocation(locations)