def from_manufacturer(manufacturer): models = [r for r in extract_subclasses(Router) if r.manufacturer == manufacturer] if not models: raise ModelNotFoundError('Manufacturer not found.') return models
def from_manufacturer(manufacturer): models = [ r for r in extract_subclasses(Router) if r.manufacturer == manufacturer ] if not models: raise ModelNotFoundError('Manufacturer not found.') return models
def list(): available = [r.as_str() for r in extract_subclasses(Router)] return sorted(available)
def test_it_extract_all_subclasses_inclusive_derived(self): subclasses = extractor.extract_subclasses(A) self.assertTrue(B in subclasses) self.assertTrue(C in subclasses)