diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 5675c25..d1017b9 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,13 +1,11 @@ # Issue/Feature description -* +* # How it was fixed/implemented -* +* # Tests -* - -# Reviewers +* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69e2f6a..b20ac91 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,10 +2,6 @@ # you can turn it on using a cron schedule for regular testing. name: Unit Tests on: - pull_request: - paths-ignore: - - 'README.md' - - 'docs/**' push: paths-ignore: - 'README.md' @@ -17,10 +13,10 @@ jobs: timeout-minutes: 5 steps: - uses: actions/checkout@v3 - - name: Set up Python 3.6 + - name: Set up Python 3.8 uses: actions/setup-python@v3 with: - python-version: '3.6' + python-version: '3.8' - name: Install dependencies run: | python -m pip install --upgrade pip @@ -31,7 +27,7 @@ jobs: TOXENV: pep8 test: name: Unit Test - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 timeout-minutes: 15 strategy: fail-fast: false @@ -72,10 +68,10 @@ jobs: timeout-minutes: 5 steps: - uses: actions/checkout@v3 - - name: Set up Python 3.6 + - name: Set up Python 3.8 uses: actions/setup-python@v3 with: - python-version: '3.6' + python-version: '3.8' - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/tests/test_connector.py b/tests/test_connector.py index 9a62cd0..049312d 100644 --- a/tests/test_connector.py +++ b/tests/test_connector.py @@ -176,7 +176,8 @@ def test_get_object_with_default_and_extattrs(self): return_fields=return_fields ) patched_get.assert_called_once_with( - 'https://infoblox.example.org/wapi/v1.1/network?%2ASubnet+ID=fake_subnet_id&_return_fields%2B=extattrs', # noqa: E501 + 'https://infoblox.example.org/wapi/v1.1/network?%2ASubnet+ID=fake_subnet_id&_return_fields%2B=extattrs', + # noqa: E501 headers=self.connector.DEFAULT_HEADER, timeout=self.default_opts.http_request_timeout, verify=self.default_opts.ssl_verify, @@ -197,7 +198,8 @@ def test_get_object_with_specific_return_fields(self): return_fields=return_fields ) patched_get.assert_called_once_with( - 'https://infoblox.example.org/wapi/v1.1/network?%2ASubnet+ID=fake_subnet_id&_return_fields=extattrs', # noqa: E501 + 'https://infoblox.example.org/wapi/v1.1/network?%2ASubnet+ID=fake_subnet_id&_return_fields=extattrs', + # noqa: E501 headers=self.connector.DEFAULT_HEADER, timeout=self.default_opts.http_request_timeout, verify=self.default_opts.ssl_verify, @@ -340,14 +342,16 @@ def test_construct_url_with_query_params_and_extattrs(self): query_params=query_params, extattrs=ext_attrs) self.assertEqual( - 'https://infoblox.example.org/wapi/v1.1/network?%2ASubnet+ID=fake_subnet_id&some_option=some_value', # noqa: E501 + 'https://infoblox.example.org/wapi/v1.1/network?%2ASubnet+ID=fake_subnet_id&some_option=some_value', + # noqa: E501 url) def test_construct_url_with_query_params_containing_array(self): query_params = {'array_option': ['value1', 'value2']} url = self.connector._construct_url('network', query_params=query_params) - self.assertEqual('https://infoblox.example.org/wapi/v1.1/network?array_option=value1&array_option=value2', # noqa: E501 + self.assertEqual('https://infoblox.example.org/wapi/v1.1/network?array_option=value1&array_option=value2', + # noqa: E501 url) def test_construct_url_with_force_proxy(self): @@ -355,7 +359,8 @@ def test_construct_url_with_force_proxy(self): url = self.connector._construct_url('network', extattrs=ext_attrs, force_proxy=True) - self.assertEqual('https://infoblox.example.org/wapi/v1.1/network?%2ASubnet+ID=fake_subnet_id&_proxy_search=GM', # noqa: E501 + self.assertEqual('https://infoblox.example.org/wapi/v1.1/network?%2ASubnet+ID=fake_subnet_id&_proxy_search=GM', + # noqa: E501 url) def test_get_object_with_proxy_flag(self): @@ -370,8 +375,7 @@ def test_get_object_with_proxy_flag(self): {}, None, force_proxy=True) - self.connector._get_object.called_with('network', - self.connector._construct_url) + self.connector._get_object.assert_called_with('network', mock.ANY) def test_get_object_without_proxy_flag(self): self.connector._get_object = mock.MagicMock( diff --git a/tox.ini b/tox.ini index f6a4566..1ec3aca 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ deps = -rtesting_requirements.txt setenv = passenv = * -whitelist_externals=mkdir +allowlist_externals = mkdir commands = mkdir -p {[setup]results} nosetests tests \