def test_find_content_hierarchy_import_errors_get_raised(self): try: findcontent('badimport1:Foo') assert False except HierarchyImportError as e: assert 'module "nothere" not found; searched compstack' in str( e), e
def test_find_content_no_module_app_level(self): try: findcontent('NotThere') assert False except HierarchyImportError as e: assert 'An object for Content endpoint "NotThere" was not found' == str( e), e
def test_find_content_no_attribute(self): try: findcontent('tests:NotThere') assert False except HierarchyImportError as e: assert 'An object for Content endpoint "tests:NotThere" was not found' == str( e), e
def test_find_content_no_module(self): try: findcontent('routingtests:Foo') assert False except HierarchyImportError as e: assert 'An object for Content endpoint "routingtests:Foo" was not found' == str( e), e
def test_find_content_no_component(self): try: findcontent('notacomponent:Foo') assert False except HierarchyImportError as e: assert 'An object for Content endpoint "notacomponent:Foo" was not found' == str( e), e
def test_find_content_no_object_app_level(self): from appstack.content import iexist assert iexist try: findcontent('NotThere') assert False except HierarchyImportError as e: assert 'An object for Content endpoint "NotThere" was not found' == str(e), e
def test_find_content_no_object_app_level(self): from appstack.content import iexist assert iexist try: findcontent('NotThere') assert False except HierarchyImportError as e: assert 'An object for Content endpoint "NotThere" was not found' == str( e), e
def getcontent(__endpoint, *args, **kwargs): if '.' in __endpoint: c = TemplateContent(__endpoint) else: klass = findcontent(__endpoint) c = klass() c.process(*args, **kwargs) return c
def test_find_content_no_module_app_level(self): try: findcontent('NotThere') assert False except HierarchyImportError as e: assert 'An object for Content endpoint "NotThere" was not found' == str(e), e
def test_find_content_hierarchy_import_errors_get_raised(self): try: findcontent('badimport1:Foo') assert False except HierarchyImportError as e: assert 'module "nothere" not found; searched compstack' in str(e), e
def test_find_content_no_attribute(self): try: findcontent('tests:NotThere') assert False except HierarchyImportError as e: assert 'An object for Content endpoint "tests:NotThere" was not found' == str(e), e
def test_find_content_no_module(self): try: findcontent('routingtests:Foo') assert False except HierarchyImportError as e: assert 'An object for Content endpoint "routingtests:Foo" was not found' == str(e), e
def test_find_content_no_component(self): try: findcontent('notacomponent:Foo') assert False except HierarchyImportError as e: assert 'An object for Content endpoint "notacomponent:Foo" was not found' == str(e), e