def test_it_works_without_stripping_any_suffixes(self): class SomeCtrl(Controller): pass assert controller_name(SomeCtrl) == 'some_ctrl'
def test_it_strips_method_view(self): class RoleMethodView(Resource): pass assert controller_name(RoleMethodView) == 'role'
def test_it_only_strips_one_suffix(self): class RoleViewControllerResource(Resource): pass assert controller_name( RoleViewControllerResource) == 'role_view_controller'
def test_it_strips_resource(self): class UserResource(Resource): pass assert controller_name(UserResource) == 'user'
def test_it_works_with_more_than_one_word(self): class MoreThanOneWordController(Controller): pass assert controller_name( MoreThanOneWordController) == 'more_than_one_word'
def test_it_strips_view(self): class SomeView(Controller): pass assert controller_name(SomeView) == 'some'
def test_it_handles_acronyms(self): class APIController(Controller): pass assert controller_name(APIController) == 'api'
def test_it_strips_controller(self): class UserController(Controller): pass assert controller_name(UserController) == 'user'