Closed ghost closed 1 year ago
Travis is going to fail because it's pointed to a defunct openvas instance. I'm going to turn travis off and try to test it locally but I might just accept once the conflict is fixed
You going to have to refresh my memory here, I haven't written any Python in a while.
I think there is a fixture missing? You probably forgot to commit a def mocker(request)
def test_response_exceptions(mocker, test_input, expected): E fixture 'mocker' not found
How did you setup the test environment for yourself?
Hi Martin, I set it up as per the instructions I put in doc/testing.md.
Hope that helps!
Hey Anna @jal58 , thanks for adding the testing docs, my goodness why did I think it was good idea to go all out on tox haha. Is this a breaking change or can this be a minor semver?
[jal58@mandolin pyvas]$ source venv/bin/activate (venv) [jal58@mandolin pyvas]$ python -m pytest -v ============================= test session starts ============================== platform linux -- Python 3.4.8, pytest-3.6.1, py-1.5.3, pluggy-0.6.0 -- /home/jal58/projects/pyvas/venv/bin/python cachedir: .pytest_cache rootdir: /home/jal58/projects/pyvas, inifile: setup.cfg plugins: mock-1.10.0, cov-2.5.1 collected 96 items
tests/test_client.py::test_environment PASSED [ 1%] tests/test_client.py::test_client_authenticate PASSED [ 2%] tests/test_client.py::test_client_send_request PASSED [ 3%] tests/test_client.py::TestMiscMethods::test_empty_trashcan PASSED [ 4%] tests/test_client.py::TestClientGenericMethods::test_list[config] PASSED [ 5%] tests/test_client.py::TestClientGenericMethods::test_list[port_list] PASSED [ 6%] tests/test_client.py::TestClientGenericMethods::test_list[nvt] PASSED [ 7%] tests/test_client.py::TestClientGenericMethods::test_list[nvt_family] PASSED [ 8%] tests/test_client.py::TestClientGenericMethods::test_list[task] PASSED [ 9%] tests/test_client.py::TestClientGenericMethods::test_list[user] PASSED [ 10%] tests/test_client.py::TestClientGenericMethods::test_list_with_arguments[config] PASSED [ 11%] tests/test_client.py::TestClientGenericMethods::test_list_with_arguments[port_list] PASSED [ 12%] tests/test_client.py::TestClientGenericMethods::test_list_with_arguments[nvt] PASSED [ 13%] tests/test_client.py::TestClientGenericMethods::test_list_with_arguments[nvt_family] PASSED [ 14%] tests/test_client.py::TestClientGenericMethods::test_list_with_arguments[task] PASSED [ 15%] tests/test_client.py::TestClientGenericMethods::test_list_with_arguments[user] PASSED [ 16%] tests/test_client.py::TestClientGenericMethods::test_get PASSED [ 17%] tests/test_client.py::TestClientGenericMethods::test_map[config] PASSED [ 18%] tests/test_client.py::TestClientGenericMethods::test_map[port_list] PASSED [ 19%] tests/test_client.py::TestClientGenericMethods::test_map[nvt] PASSED [ 20%] tests/test_client.py::TestClientGenericMethods::test_map[nvt_family] PASSED [ 21%] tests/test_client.py::TestClientGenericMethods::test_map[task] PASSED [ 22%] tests/test_client.py::TestClientGenericMethods::test_map[user] PASSED [ 23%] tests/test_client.py::TestPortLists::test_create_port_list PASSED [ 25%] tests/test_client.py::TestPortLists::test_list_port_lists PASSED [ 26%] tests/test_client.py::TestPortLists::test_list_filter_port_list PASSED [ 27%] tests/test_client.py::TestPortLists::test_get_port_list PASSED [ 28%] tests/test_client.py::TestPortLists::test_delete_port_list PASSED [ 29%] tests/test_client.py::TestTargets::test_create_target PASSED [ 30%] tests/test_client.py::TestTargets::test_list_targets PASSED [ 31%] tests/test_client.py::TestTargets::test_list_filter_targets PASSED [ 32%] tests/test_client.py::TestTargets::test_get_target PASSED [ 33%] tests/test_client.py::TestTargets::test_modify_target PASSED [ 34%] tests/test_client.py::TestTargets::test_delete_target PASSED [ 35%] tests/test_client.py::TestConfigs::test_create_config PASSED [ 36%] tests/test_client.py::TestConfigs::test_copy_config_by_name PASSED [ 37%] tests/test_client.py::TestConfigs::test_delete_config_by_name PASSED [ 38%] tests/test_client.py::TestConfigs::test_list_configs PASSED [ 39%] tests/test_client.py::TestConfigs::test_list_filter_configs PASSED [ 40%] tests/test_client.py::TestConfigs::test_get_config PASSED [ 41%] tests/test_client.py::TestConfigs::test_get_config_by_name PASSED [ 42%] tests/test_client.py::TestConfigs::test_list_config_families PASSED [ 43%] tests/test_client.py::TestConfigs::test_delete_config PASSED [ 44%] tests/test_client.py::TestConfigs::test_map_config_names PASSED [ 45%] tests/test_client.py::TestConfigs::test_list_config_nvts[Full and fast] PASSED [ 46%] tests/test_client.py::TestConfigs::test_list_config_nvts[empty] PASSED [ 47%] tests/test_client.py::TestScanners::test_list_scanners PASSED [ 48%] tests/test_client.py::TestScanners::test_list_filter_scanners PASSED [ 50%] tests/test_client.py::TestScanners::test_get_scanner PASSED [ 51%] tests/test_client.py::TestReportFormats::test_list_report_formats PASSED [ 52%] tests/test_client.py::TestReportFormats::test_list_filter_report_formats PASSED [ 53%] tests/test_client.py::TestReportFormats::test_get_report_format PASSED [ 54%] tests/test_client.py::TestTasks::test_create_task PASSED [ 55%] tests/test_client.py::TestTasks::test_list_tasks PASSED [ 56%] tests/test_client.py::TestTasks::test_get_task PASSED [ 57%] tests/test_client.py::TestTasks::test_start_task PASSED [ 58%] tests/test_client.py::TestTasks::test_stop_task PASSED [ 59%] tests/test_client.py::TestTasks::test_resume_task PASSED [ 60%] tests/test_client.py::TestTasks::test_delete_task PASSED [ 61%] tests/test_client.py::TestReports::test_list_reports PASSED [ 62%] tests/test_client.py::TestReports::test_get_report PASSED [ 63%] tests/test_client.py::TestReports::test_download_report_with_xml_format PASSED [ 64%] tests/test_client.py::TestReports::test_download_report_with_html_format PASSED [ 65%] tests/test_client.py::TestResults::test_list_results PASSED [ 66%] tests/test_client.py::TestSchedules::test_create_schedule PASSED [ 67%] tests/test_client.py::TestSchedules::test_get_schedule PASSED [ 68%] tests/test_client.py::TestSchedules::test_list_schedules PASSED [ 69%] tests/test_client.py::TestSchedules::test_modify_schedule PASSED [ 70%] tests/test_client.py::TestSchedules::test_delete_schedule PASSED [ 71%] tests/test_client.py::TestNVTs::test_list_nvt_families PASSED [ 72%] tests/test_client.py::TestNVTs::test_map_nvts PASSED [ 73%] tests/test_client.py::TestNVTs::test_map_nvts_to_families PASSED [ 75%] tests/test_client.py::TestNVTs::test_list_nvts PASSED [ 76%] tests/test_client.py::TestNVTs::test_list_nvts_with_details PASSED [ 77%] tests/test_client.py::TestNVTs::test_get_nvt PASSED [ 78%] tests/test_exceptions.py::test_base_error PASSED [ 79%] tests/test_exceptions.py::test_result_error PASSED [ 80%] tests/test_exceptions.py::test_authentication_error PASSED [ 81%] tests/test_exceptions.py::test_request_error PASSED [ 82%] tests/test_exceptions.py::test_http_error PASSED [ 83%] tests/test_exceptions.py::test_element_exists PASSED [ 84%] tests/test_exceptions.py::test_element_not_found PASSED [ 85%] tests/test_exceptions.py::test_invalid_argument PASSED [ 86%] tests/test_exceptions.py::test_server_error PASSED [ 87%] tests/test_response.py::test_response_init PASSED [ 88%] tests/test_response.py::test_response_dict_interface PASSED [ 89%] tests/test_response.py::test_response_callback PASSED [ 90%] tests/test_response.py::test_response_exceptions[test_input0-TypeError] PASSED [ 91%] tests/test_response.py::test_response_exceptions[test_input1-ElementExists] PASSED [ 92%] tests/test_response.py::test_response_exceptions[test_input2-InvalidArgumentError] PASSED [ 93%] tests/test_response.py::test_response_exceptions[test_input3-ElementNotFound] PASSED [ 94%] tests/test_response.py::test_response_exceptions[test_input4-HTTPError] PASSED [ 95%] tests/test_response.py::test_response_exceptions[test_input5-ServerError] PASSED [ 96%] tests/test_response.py::test_response_result_error PASSED [ 97%] tests/test_utils.py::test_dict_to_lxml_function PASSED [ 98%] tests/test_utils.py::test_lxml_to_dict PASSED [100%]Coverage.py warning: No data was collected. (no-data-collected)
TOTAL 620 620 209 0 0% Coverage HTML written to dir htmlcov
===================================== 96 passed in 323.31 seconds ====================================== (venv) [jal58@mandolin pyvas]$
Is this going to be merged
This pull request contains new functionality in client.py, and new corresponding tests. As well as some documentation in the doc directory.