summaryrefslogtreecommitdiff
path: root/tests/unit/mock
diff options
context:
space:
mode:
authorNilashish Chakraborty <nilashishchakraborty8@gmail.com>2024-06-25 14:54:01 +0530
committerGitHub <noreply@github.com>2024-06-25 14:54:01 +0530
commitb872b6f21d14ff10c221d84217eb568318e9ad8b (patch)
tree0aacdea877a7e2b209735cd0f7c0b9d62a9446f7 /tests/unit/mock
parent37baff3d4d547911bec1387218edfd477ca79062 (diff)
downloadvyos.vyos-b872b6f21d14ff10c221d84217eb568318e9ad8b.tar.gz
vyos.vyos-b872b6f21d14ff10c221d84217eb568318e9ad8b.zip
`vyos.vyos` is no longer deprecated! 🎉 (#348)
* Remove deprecation notice for vyos.vyos Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Add changelog Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * fix review comments Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * chore: auto fixes from pre-commit.com hooks --------- Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'tests/unit/mock')
-rw-r--r--tests/unit/mock/loader.py1
-rw-r--r--tests/unit/mock/path.py2
-rw-r--r--tests/unit/mock/procenv.py2
-rw-r--r--tests/unit/mock/vault_helper.py1
-rw-r--r--tests/unit/mock/yaml_helper.py10
5 files changed, 14 insertions, 2 deletions
diff --git a/tests/unit/mock/loader.py b/tests/unit/mock/loader.py
index 2828f38e..67b84c62 100644
--- a/tests/unit/mock/loader.py
+++ b/tests/unit/mock/loader.py
@@ -18,6 +18,7 @@
# Make coding more python3-ish
from __future__ import absolute_import, division, print_function
+
__metaclass__ = type
import os
diff --git a/tests/unit/mock/path.py b/tests/unit/mock/path.py
index 3962f24f..1f1b7f0a 100644
--- a/tests/unit/mock/path.py
+++ b/tests/unit/mock/path.py
@@ -1,8 +1,10 @@
from __future__ import absolute_import, division, print_function
+
__metaclass__ = type
from ansible.utils.path import unfrackpath
from ansible_collections.vyos.vyos.tests.unit.compat.mock import MagicMock
+
mock_unfrackpath_noop = MagicMock(spec_set=unfrackpath, side_effect=lambda x, *args, **kwargs: x)
diff --git a/tests/unit/mock/procenv.py b/tests/unit/mock/procenv.py
index 06987e31..d7f3dc95 100644
--- a/tests/unit/mock/procenv.py
+++ b/tests/unit/mock/procenv.py
@@ -19,10 +19,12 @@
# Make coding more python3-ish
from __future__ import absolute_import, division, print_function
+
__metaclass__ = type
import json
import sys
+
from contextlib import contextmanager
from io import BytesIO, StringIO
diff --git a/tests/unit/mock/vault_helper.py b/tests/unit/mock/vault_helper.py
index 4c6c890c..6006ba96 100644
--- a/tests/unit/mock/vault_helper.py
+++ b/tests/unit/mock/vault_helper.py
@@ -14,6 +14,7 @@
# Make coding more python3-ish
from __future__ import absolute_import, division, print_function
+
__metaclass__ = type
from ansible.module_utils._text import to_bytes
diff --git a/tests/unit/mock/yaml_helper.py b/tests/unit/mock/yaml_helper.py
index 540055d2..2e857592 100644
--- a/tests/unit/mock/yaml_helper.py
+++ b/tests/unit/mock/yaml_helper.py
@@ -1,9 +1,11 @@
from __future__ import absolute_import, division, print_function
+
__metaclass__ = type
import io
import yaml
+
from ansible.module_utils.six import PY3
from ansible.parsing.yaml.dumper import AnsibleDumper
from ansible.parsing.yaml.loader import AnsibleLoader
@@ -115,10 +117,14 @@ class YamlTestUtils(object):
yaml_string_obj_from_string = yaml.dump(obj_from_string, Dumper=AnsibleDumper)
else:
yaml_string_obj_from_stream = yaml.dump(
- obj_from_stream, Dumper=AnsibleDumper, encoding=None
+ obj_from_stream,
+ Dumper=AnsibleDumper,
+ encoding=None,
)
yaml_string_obj_from_string = yaml.dump(
- obj_from_string, Dumper=AnsibleDumper, encoding=None
+ obj_from_string,
+ Dumper=AnsibleDumper,
+ encoding=None,
)
assert yaml_string == yaml_string_obj_from_stream