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

smb: improve smb module test coverage #57394

Merged
merged 13 commits into from
Jul 1, 2024

Commits on Jun 24, 2024

  1. mgr/smb: move a handful of small functions to utils.py

    Includes updating the files that were using them and even
    a few test functions.
    Amusingly, the `one` function was being tested as part of
    test_handler.py demonstrating the confusion that not having
    a utils.py and corresponding test file brought.
    
    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    b400196 View commit details
    Browse the repository at this point in the history
  2. mgr/smb: add test coverage for all utils.py functions

    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    3631692 View commit details
    Browse the repository at this point in the history
  3. mgr/smb: add test coverage for expanding login access enum

    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    166a97d View commit details
    Browse the repository at this point in the history
  4. mgr/smb: fix some incorrect f-strings when raising validation error

    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    660d74b View commit details
    Browse the repository at this point in the history
  5. mgr/smb: add more test cases for resource validation errors

    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    4774a68 View commit details
    Browse the repository at this point in the history
  6. mgr/smb: fix and test load_text function

    The load_text function was a bit buggy but mainly worked until I started
    to try and write a proper test for it. The error handling here is a bit
    of a hack, but we can refine it later if people notice/complain.
    
    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    55d7e0f View commit details
    Browse the repository at this point in the history
  7. mgr/smb: fix an incorrect comment

    At one point the comment was true but I ended doing a workaround
    enabling a wrapper in proto.py of typing_extensions.Self and using it
    here turning the comment untrue.
    
    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    439ae54 View commit details
    Browse the repository at this point in the history
  8. mgr/smb: extra check that we don't iterate over non-lists

    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    bba802a View commit details
    Browse the repository at this point in the history
  9. mgr/smb: make InvalidResourceError based on ErrorResponseBase

    Make InvalidResourceError based on ErrorResponseBase as well as
    ValueError for consistency with the InvalidInputError class and in the
    case it ever fails to be wrapped by a Response type.
    
    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    29e85e5 View commit details
    Browse the repository at this point in the history
  10. mgr/smb: improve error case test coverage for handler

    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    c2101dd View commit details
    Browse the repository at this point in the history
  11. mgr/smb: add heavily mocked unit test for fs.py module

    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    cc44a3d View commit details
    Browse the repository at this point in the history
  12. mgr/smb: add test coverage for creating users with cluster

    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    632e516 View commit details
    Browse the repository at this point in the history
  13. mgr/smb: add test coverage for show command

    Signed-off-by: John Mulligan <jmulligan@redhat.com>
    phlogistonjohn committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    39584a1 View commit details
    Browse the repository at this point in the history