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

Improve stop/start behavior of DB's related functions #1068

Merged
merged 4 commits into from
Feb 16, 2021

Conversation

BraulioV
Copy link
Contributor

Related issue
closes #1057

Description

This PR adds a new decorator that simplifies the creation of mocking functions.

Configuration options

NA

Logs example

# python3 -m pytest test_scan_results/test_scan_*
============================================================================================== test session starts ==============================================================================================
platform linux -- Python 3.6.8, pytest-5.4.2, py-1.8.1, pluggy-0.13.1
rootdir: /tmp/wazuh-qa/tests/integration, inifile: pytest.ini
plugins: metadata-1.9.0, html-2.0.1, testinfra-5.0.0
collected 31 items

test_scan_results/test_scan_different_cves.py .........                                                                                                                                                   [ 29%]
test_scan_results/test_scan_nvd_feed.py .............                                                                                                                                                     [ 70%]
test_scan_results/test_scan_providers_and_nvd_feed.py .........                                                                                                                                           [100%]

======================================================================================== 31 passed in 323.20s (0:05:23) =========================================================================================

Tests

  • Proven that tests pass when they have to pass.
  • Proven that tests fail when they have to fail.
  • Python codebase satisfies PEP-8 style style guide. pycodestyle --max-line-length=120 --show-source --show-pep8 file.py

spothound
spothound previously approved these changes Feb 16, 2021
Copy link
Contributor

@spothound spothound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!

jmv74211
jmv74211 previously approved these changes Feb 16, 2021
@BraulioV BraulioV dismissed stale reviews from jmv74211 and spothound via b5c8122 February 16, 2021 14:37
@BraulioV BraulioV merged commit 6af9382 into master Feb 16, 2021
@BraulioV BraulioV deleted the add-mock-decorator branch February 16, 2021 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delegate responsibility for stopping and starting wazuh-db to the function make_query
3 participants