Пример #1
0
 def test_it_works_without_stripping_any_suffixes(self):
     class SomeCtrl(Controller):
         pass
     assert controller_name(SomeCtrl) == 'some_ctrl'
Пример #2
0
 def test_it_strips_method_view(self):
     class RoleMethodView(Resource):
         pass
     assert controller_name(RoleMethodView) == 'role'
Пример #3
0
 def test_it_only_strips_one_suffix(self):
     class RoleViewControllerResource(Resource):
         pass
     assert controller_name(RoleViewControllerResource) == 'role_view_controller'
Пример #4
0
 def test_it_strips_resource(self):
     class UserResource(Resource):
         pass
     assert controller_name(UserResource) == 'user'
Пример #5
0
 def test_it_works_with_more_than_one_word(self):
     class MoreThanOneWordController(Controller):
         pass
     assert controller_name(MoreThanOneWordController) == 'more_than_one_word'
Пример #6
0
 def test_it_strips_view(self):
     class SomeView(Controller):
         pass
     assert controller_name(SomeView) == 'some'
Пример #7
0
    def test_it_handles_acronyms(self):
        class APIController(Controller):
            pass

        assert controller_name(APIController) == 'api'
Пример #8
0
 def test_it_strips_controller(self):
     class UserController(Controller):
         pass
     assert controller_name(UserController) == 'user'