From 51a40222b1b43163314247fa9d33ffed20844df566dd5ceef660ed098d6b91c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 25 Apr 2019 07:39:20 +0000 Subject: [PATCH] Accepting request 697734 from home:pgajdos - added patches fix https://github.com/softlayer/softlayer-python/issues/1095 + python-softlayer-fix-teset_setup_cancel.patch OBS-URL: https://build.opensuse.org/request/show/697734 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-softlayer?expand=0&rev=7 --- python-softlayer-fix-teset_setup_cancel.patch | 19 +++++++++++++++++++ python-softlayer.changes | 7 +++++++ python-softlayer.spec | 6 ++++-- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 python-softlayer-fix-teset_setup_cancel.patch diff --git a/python-softlayer-fix-teset_setup_cancel.patch b/python-softlayer-fix-teset_setup_cancel.patch new file mode 100644 index 0000000..fe2217f --- /dev/null +++ b/python-softlayer-fix-teset_setup_cancel.patch @@ -0,0 +1,19 @@ +diff --git a/tests/CLI/modules/config_tests.py b/tests/CLI/modules/config_tests.py +index 4fe9cf86..ec018a53 100644 +--- a/tests/CLI/modules/config_tests.py ++++ b/tests/CLI/modules/config_tests.py +@@ -75,10 +75,12 @@ def test_setup(self, mocked_input, getpass, confirm_mock, client): + self.assertTrue('api_key = AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' in contents) + self.assertTrue('endpoint_url = %s' % consts.API_PUBLIC_ENDPOINT in contents) + ++ @mock.patch('SoftLayer.Client') + @mock.patch('SoftLayer.CLI.formatting.confirm') + @mock.patch('SoftLayer.CLI.environment.Environment.getpass') + @mock.patch('SoftLayer.CLI.environment.Environment.input') +- def test_setup_cancel(self, mocked_input, getpass, confirm_mock): ++ def test_setup_cancel(self, mocked_input, getpass, confirm_mock, client): ++ client.return_value = self.env.client + with tempfile.NamedTemporaryFile() as config_file: + confirm_mock.return_value = False + getpass.return_value = 'A' * 64 + diff --git a/python-softlayer.changes b/python-softlayer.changes index f69ba50..ea5fbae 100644 --- a/python-softlayer.changes +++ b/python-softlayer.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Apr 25 06:27:39 UTC 2019 - pgajdos@suse.com + +- added patches + fix https://github.com/softlayer/softlayer-python/issues/1095 + + python-softlayer-fix-teset_setup_cancel.patch + ------------------------------------------------------------------- Tue Apr 9 13:07:50 UTC 2019 - pgajdos@suse.com diff --git a/python-softlayer.spec b/python-softlayer.spec index ed9700e..a7d3bba 100644 --- a/python-softlayer.spec +++ b/python-softlayer.spec @@ -25,6 +25,8 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/softlayer/softlayer-python Source: https://github.com/softlayer/softlayer-python/archive/v%{version}.tar.gz +# fix https://github.com/softlayer/softlayer-python/issues/1095 +Patch0: python-softlayer-fix-teset_setup_cancel.patch BuildRequires: %{python_module PrettyTable >= 0.7.0} BuildRequires: %{python_module click} BuildRequires: %{python_module mock} @@ -53,6 +55,7 @@ This library provides a simple Python client to interact with SoftLayer's XML-RP %prep %setup -q -n softlayer-python-%{version} +%patch0 -p1 %build %python_build @@ -64,8 +67,7 @@ This library provides a simple Python client to interact with SoftLayer's XML-RP %python_expand %fdupes -s %{buildroot}%{$python_sitelib} %check -# https://github.com/softlayer/softlayer-python/issues/1095#issuecomment-481233467 -%pytest -k 'not test_setup_cancel' +%pytest %files %{python_files} %license LICENSE