-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fall back from distutils -> packaging.version (bugfix) (#1203)
* Remove dependency on distutils -> packaging.version * Test the changes Minor: black formatting * Fixed return value * NOQA flake8 builtins * two spaces whatever * No fall back, only new thing
- Loading branch information
Showing
4 changed files
with
85 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright 2024 Canonical Ltd. | ||
# Written by: | ||
# Massimiliano Girardi <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License version 3, | ||
# as published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
import unittest | ||
from unittest.mock import patch | ||
|
||
from wifi_nmcli_backup import legacy_nmcli | ||
|
||
|
||
class WifiNmcliBackupTests(unittest.TestCase): | ||
@patch("wifi_nmcli_backup.sp") | ||
def test_legacy_nmcli_true(self, subprocess_mock): | ||
subprocess_mock.check_output.return_value = ( | ||
b"nmcli tool, version 1.11.3-5" | ||
) | ||
self.assertTrue(legacy_nmcli()) | ||
|
||
@patch("wifi_nmcli_backup.sp") | ||
def test_legacy_nmcli_false(self, subprocess_mock): | ||
subprocess_mock.check_output.return_value = ( | ||
b"nmcli tool, version 1.46.0-2" | ||
) | ||
self.assertFalse(legacy_nmcli()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright 2024 Canonical Ltd. | ||
# Written by: | ||
# Massimiliano Girardi <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License version 3, | ||
# as published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
import unittest | ||
from unittest.mock import patch | ||
|
||
from wifi_nmcli_test import legacy_nmcli | ||
|
||
|
||
class WifiNmcliBackupTests(unittest.TestCase): | ||
@patch("wifi_nmcli_test.sp") | ||
def test_legacy_nmcli_true(self, subprocess_mock): | ||
subprocess_mock.check_output.return_value = ( | ||
b"nmcli tool, version 1.9.8-5" | ||
) | ||
self.assertTrue(legacy_nmcli()) | ||
|
||
@patch("wifi_nmcli_test.sp") | ||
def test_legacy_nmcli_false(self, subprocess_mock): | ||
subprocess_mock.check_output.return_value = ( | ||
b"nmcli tool, version 1.46.0-2" | ||
) | ||
self.assertFalse(legacy_nmcli()) |