Compare commits
2 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 375c86df6b | |||
| 19c9657fe1 |
106
migrate-to-setup-method.patch
Normal file
106
migrate-to-setup-method.patch
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
From a9349dfdc1d8e7a915567766e0d18b07544323dc Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?=C5=81ukasz=20Kostka?= <lukasz.g.kostka@gmail.com>
|
||||||
|
Date: Thu, 22 Jun 2023 14:55:54 +0200
|
||||||
|
Subject: [PATCH] Migrate to setup_method
|
||||||
|
|
||||||
|
https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
|
||||||
|
---
|
||||||
|
tests/unit/test_api.py | 2 +-
|
||||||
|
tests/unit/test_connections.py | 2 +-
|
||||||
|
tests/unit/test_path.py | 2 +-
|
||||||
|
tests/unit/test_protocol.py | 6 +++---
|
||||||
|
tests/unit/test_query.py | 4 ++--
|
||||||
|
5 files changed, 8 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
Index: librouteros-3.2.1/tests/unit/test_api.py
|
||||||
|
===================================================================
|
||||||
|
--- librouteros-3.2.1.orig/tests/unit/test_api.py
|
||||||
|
+++ librouteros-3.2.1/tests/unit/test_api.py
|
||||||
|
@@ -37,7 +37,7 @@ def test_compose_word(word_pair):
|
||||||
|
|
||||||
|
class Test_Api:
|
||||||
|
|
||||||
|
- def setup(self):
|
||||||
|
+ def setup_method(self):
|
||||||
|
self.api = Api(protocol=MagicMock())
|
||||||
|
|
||||||
|
@patch.object(Api, 'readResponse')
|
||||||
|
Index: librouteros-3.2.1/tests/unit/test_connections.py
|
||||||
|
===================================================================
|
||||||
|
--- librouteros-3.2.1.orig/tests/unit/test_connections.py
|
||||||
|
+++ librouteros-3.2.1/tests/unit/test_connections.py
|
||||||
|
@@ -14,7 +14,7 @@ from librouteros.exceptions import (
|
||||||
|
|
||||||
|
class Test_SocketTransport:
|
||||||
|
|
||||||
|
- def setup(self):
|
||||||
|
+ def setup_method(self):
|
||||||
|
self.transport = SocketTransport(sock=MagicMock(spec=socket))
|
||||||
|
|
||||||
|
def test_calls_socket_close(self):
|
||||||
|
Index: librouteros-3.2.1/tests/unit/test_path.py
|
||||||
|
===================================================================
|
||||||
|
--- librouteros-3.2.1.orig/tests/unit/test_path.py
|
||||||
|
+++ librouteros-3.2.1/tests/unit/test_path.py
|
||||||
|
@@ -19,7 +19,7 @@ def test_api_path_returns_Path():
|
||||||
|
|
||||||
|
class Test_Path:
|
||||||
|
|
||||||
|
- def setup(self):
|
||||||
|
+ def setup_method(self):
|
||||||
|
self.path = Path(
|
||||||
|
path='/interface',
|
||||||
|
api=MagicMock(),
|
||||||
|
Index: librouteros-3.2.1/tests/unit/test_protocol.py
|
||||||
|
===================================================================
|
||||||
|
--- librouteros-3.2.1.orig/tests/unit/test_protocol.py
|
||||||
|
+++ librouteros-3.2.1/tests/unit/test_protocol.py
|
||||||
|
@@ -18,7 +18,7 @@ from librouteros.exceptions import (
|
||||||
|
|
||||||
|
class Test_Decoder:
|
||||||
|
|
||||||
|
- def setup(self):
|
||||||
|
+ def setup_method(self):
|
||||||
|
self.decoder = Decoder()
|
||||||
|
self.decoder.encoding = 'ASCII'
|
||||||
|
|
||||||
|
@@ -51,7 +51,7 @@ class Test_Decoder:
|
||||||
|
|
||||||
|
class Test_Encoder:
|
||||||
|
|
||||||
|
- def setup(self):
|
||||||
|
+ def setup_method(self):
|
||||||
|
self.encoder = Encoder()
|
||||||
|
self.encoder.encoding = 'ASCII'
|
||||||
|
|
||||||
|
@@ -98,7 +98,7 @@ class Test_Encoder:
|
||||||
|
|
||||||
|
class Test_ApiProtocol:
|
||||||
|
|
||||||
|
- def setup(self):
|
||||||
|
+ def setup_method(self):
|
||||||
|
self.protocol = ApiProtocol(
|
||||||
|
transport=MagicMock(spec=SocketTransport),
|
||||||
|
encoding='utf-8',
|
||||||
|
Index: librouteros-3.2.1/tests/unit/test_query.py
|
||||||
|
===================================================================
|
||||||
|
--- librouteros-3.2.1.orig/tests/unit/test_query.py
|
||||||
|
+++ librouteros-3.2.1/tests/unit/test_query.py
|
||||||
|
@@ -11,7 +11,7 @@ from librouteros.query import (
|
||||||
|
|
||||||
|
class Test_Query:
|
||||||
|
|
||||||
|
- def setup(self):
|
||||||
|
+ def setup_method(self):
|
||||||
|
self.query = Query(
|
||||||
|
path=MagicMock(),
|
||||||
|
api=MagicMock(),
|
||||||
|
@@ -43,7 +43,7 @@ class Test_Query:
|
||||||
|
|
||||||
|
class Test_Key:
|
||||||
|
|
||||||
|
- def setup(self):
|
||||||
|
+ def setup_method(self):
|
||||||
|
self.key = Key(name='key_name', )
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('param, expected', (
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Aug 20 04:27:52 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Add patch migrate-to-setup-method.patch:
|
||||||
|
* Migrate to using setup_method().
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jan 23 06:26:04 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
Tue Jan 23 06:26:04 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ Summary: Python implementation of MikroTik RouterOS API
|
|||||||
License: GPL-2.0-or-later
|
License: GPL-2.0-or-later
|
||||||
URL: https://github.com/luqasz/librouteros
|
URL: https://github.com/luqasz/librouteros
|
||||||
Source: https://github.com/luqasz/librouteros/archive/%{version}.tar.gz#/librouteros-%{version}.tar.gz
|
Source: https://github.com/luqasz/librouteros/archive/%{version}.tar.gz#/librouteros-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM gh#luqasz/librouteros#a9349dfdc1d8e7a915567766e0d18b07544323dc
|
||||||
|
Patch0: migrate-to-setup-method.patch
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module wheel}
|
||||||
|
|||||||
Reference in New Issue
Block a user