Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the code, create documentation to code, and update tests #43

Merged
merged 15 commits into from
Nov 12, 2023

Commits on Nov 12, 2023

  1. chore(.gitignore): add ignore rules for database configuration files …

    …in migrations and instance directories
    
    test(routes_test.py): refactor test cases to use unittest.TestCase and improve readability
    test(routes_test.py): add test case to confirm if blueprints were registered
    test(routes_test.py): add test case to verify if there are no duplicate blueprints registered
    test(routes_test.py): add test case to check if all registered routes are present
    test(routes_test.py): add test case to check if all registered endpoints are present
    test(routes_test.py): add test case to count the number of HTTP verbs registered for routes
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    219ef7a View commit details
    Browse the repository at this point in the history
  2. fix(routes_test.py): remove unused property 'endpoints' to improve co…

    …de readability and maintainability
    
    fix(routes_test.py): remove unused property 'blueprints' to improve code readability and maintainability
    refactor(routes_test.py): simplify test_when_blueprints_have_been_registered by directly comparing expected blueprints with actual blueprints
    refactor(routes_test.py): simplify test_when_not_exists_registered_blueprints by directly comparing expected blueprints with actual blueprints
    refactor(routes_test.py): simplify test_when_endpoints_have_been_registered by directly comparing expected endpoints with actual endpoints
    refactor(routes_test.py): simplify test_when_methods_have_been_registered by directly comparing expected methods with actual methods
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    2f6496d View commit details
    Browse the repository at this point in the history
  3. chore(version): update package version from 2.5.0 to 2.7.0

    test(version_test.py): add unit test to verify the updated package version is correct
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    50fff64 View commit details
    Browse the repository at this point in the history
  4. feat(tests): add conftest.py file for test fixtures and client setup

    refactor(tests): remove fixtures.py file as it is no longer needed
    feat(tests): add messages_enpoint_test.py file for testing message endpoints
    refactor(tests): remove request_test.py file as it is no longer needed
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    9b44b08 View commit details
    Browse the repository at this point in the history
  5. chore(makefile): update test command in makefile to use pytest instea…

    …d of ward for consistency with other projects
    
    chore(makefile): update format command in makefile to use line length limit of 89 characters instead of 79 characters for consistency with other projects
    chore(makefile): update check command in makefile to use line length limit of 89 characters instead of 79 characters for consistency with other projects
    chore(pyproject.toml): add flask-sqlalchemy and pytest as dev dependencies for the project
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    7e53470 View commit details
    Browse the repository at this point in the history
  6. test(routes_test.py): refactor test methods to improve readability an…

    …d maintainability
    
    test(routes_test.py): add assertions to verify that the expected blueprints have been registered
    test(routes_test.py): add assertions to verify that the expected routes have been registered
    test(routes_test.py): add assertions to verify that the expected endpoints have been registered
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    f1d49bd View commit details
    Browse the repository at this point in the history
  7. feat(router.py): add Router class for managing routes in a web applic…

    …ation
    
    The Router class provides methods to define and manage different HTTP routes (GET, POST, PUT, DELETE) for the application's controllers and actions. It includes the following methods:
    
    - `_method_route()`: Private method that organizes routes by HTTP method.
    - `namespace(name: str)`: Static method to create a namespace for routes.
    - `get(path: str, resource: str)`: Static method to define a GET route.
    - `post(path: str, resource: str)`: Static method to define a POST route.
    - `put(path: str, resource: str)`: Static method to define a PUT route.
    - `delete(path: str, resource: str)`: Static method to define a DELETE route.
    - `all(resource: str, only=None, base_path="")`: Static method to define routes for all standard RESTful actions for a resource.
    - `_add_routes(name, actions, base_path)`: Private method to add routes for specified actions under a given name and base path.
    
    fix(routes_test.py): remove empty line
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    4400de5 View commit details
    Browse the repository at this point in the history
  8. test(messages_endpoint_test.py): add tests for checking if blueprints…

    … have been registered and if messages routes and endpoints have been registered
    
    test(messages_endpoint_test.py): add tests for checking the number of registered routes and their methods
    test(messages_enpoint_test.py): delete unused test file
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    684f7ec View commit details
    Browse the repository at this point in the history
  9. chore(routes.py): remove unused route definition for "user" endpoint

    chore(conftest.py): uncomment and refactor browser fixture to use test_client() and properly handle database session
    feat(messages_form_test.py): add tests for updating and deleting messages using PUT HTTP method
    chore(routes_test.py): remove assertion for "user" blueprint in test_when_blueprints_have_been_registered() test
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    b235d1e View commit details
    Browse the repository at this point in the history
  10. chore(tests): remove outdated version test file

    test(version_test.py): update version test to use the correct version number
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    2065387 View commit details
    Browse the repository at this point in the history
  11. test(messages_endpoint_test.py): remove unnecessary blank line to imp…

    …rove code readability
    
    test(version_test.py): remove unnecessary blank line to improve code readability
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    57f9a35 View commit details
    Browse the repository at this point in the history
  12. fix(__init__.py): fix import statement for http_method_override middl…

    …eware module
    
    feat(http_method_override.py): add HTTPMethodOverrideMiddleware and CustomRequest classes to handle HTTP method override functionality
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    6300dec View commit details
    Browse the repository at this point in the history
  13. fix(messages_controller.py): refactor update method to handle both JS…

    …ON and form data for updating message title
    
    test(messages_direct_request_test.py): add tests for creating and updating a message using direct requests
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    1cfd3bc View commit details
    Browse the repository at this point in the history
  14. chore(posts_controller.py): remove unused methods and add new method …

    …to improve code organization and readability
    
    chore(user_controller.py): remove unused file to improve code organization and maintainability
    chore(routes.py): comment out unused routes to improve code organization and maintainability
    test(messages_endpoint_test copy.py): add tests to ensure proper registration of messages endpoints
    test(routes_test.py): add tests to ensure proper registration of routes and methods count
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    d337561 View commit details
    Browse the repository at this point in the history
  15. chore: bump version to 2.7.1

    Bump the version from 2.7.0 to 2.7.1 in __version__.py, pyproject.toml, and version_test.py to reflect the latest changes and improvements in the mvc-flask project.
    marcuxyz committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    ec90e2c View commit details
    Browse the repository at this point in the history