Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-openwrt-luci-rpc for 
openSUSE:Factory checked in at 2024-03-17 22:14:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-openwrt-luci-rpc (Old)
 and      /work/SRC/openSUSE:Factory/.python-openwrt-luci-rpc.new.1905 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-openwrt-luci-rpc"

Sun Mar 17 22:14:35 2024 rev:5 rq:1158397 version:1.1.17

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-openwrt-luci-rpc/python-openwrt-luci-rpc.changes
  2023-07-25 11:52:16.913866549 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-openwrt-luci-rpc.new.1905/python-openwrt-luci-rpc.changes
        2024-03-17 22:14:43.089562703 +0100
@@ -1,0 +2,8 @@
+Sat Mar 16 09:01:58 UTC 2024 - Dirk Müller <dmuel...@suse.com>
+
+- update to 1.1.17:
+  * add lower bound to version check
+  * Fix issue #60
+  * Fix tests
+
+-------------------------------------------------------------------

Old:
----
  openwrt-luci-rpc-1.1.16.tar.gz

New:
----
  openwrt-luci-rpc-1.1.17.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-openwrt-luci-rpc.spec ++++++
--- /var/tmp/diff_new_pack.PQ210D/_old  2024-03-17 22:14:44.865627674 +0100
+++ /var/tmp/diff_new_pack.PQ210D/_new  2024-03-17 22:14:44.869627819 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-openwrt-luci-rpc
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           python-openwrt-luci-rpc
-Version:        1.1.16
+Version:        1.1.17
 Release:        0
 Summary:        Module for interacting with OpenWrt Luci RPC interface
 License:        Apache-2.0

++++++ openwrt-luci-rpc-1.1.16.tar.gz -> openwrt-luci-rpc-1.1.17.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openwrt-luci-rpc-1.1.16/PKG-INFO 
new/openwrt-luci-rpc-1.1.17/PKG-INFO
--- old/openwrt-luci-rpc-1.1.16/PKG-INFO        2023-03-09 21:34:57.081500800 
+0100
+++ new/openwrt-luci-rpc-1.1.17/PKG-INFO        2024-03-04 17:10:15.299735000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: openwrt-luci-rpc
-Version: 1.1.16
+Version: 1.1.17
 Summary: Module for interacting with OpenWrt Luci RPC interface
 Home-page: https://github.com/fbradyirl/openwrt-luci-rpc
 Author: Finbarr Brady
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openwrt-luci-rpc-1.1.16/openwrt_luci_rpc/__init__.py 
new/openwrt-luci-rpc-1.1.17/openwrt_luci_rpc/__init__.py
--- old/openwrt-luci-rpc-1.1.16/openwrt_luci_rpc/__init__.py    2023-03-09 
21:34:52.000000000 +0100
+++ new/openwrt-luci-rpc-1.1.17/openwrt_luci_rpc/__init__.py    2024-03-04 
17:10:04.000000000 +0100
@@ -3,11 +3,11 @@
 """Top-level package for openwrt-luci-rpc."""
 
 __author__ = """Finbarr Brady"""
-__email__ = 'fbrady...@github.io'
-__version__ = '1.1.16'
+__email__ = "fbrady...@github.io"
+__version__ = "1.1.17"
 
-from .openwrt_luci_rpc import OpenWrtLuciRPC
 from .constants import Constants
+from .openwrt_luci_rpc import OpenWrtLuciRPC
 
 
 class OpenWrtRpc:
@@ -15,11 +15,14 @@
     Class to interact with OpenWrt router running luci-mod-rpc package.
     """
 
-    def __init__(self, host_url=Constants.DEFAULT_LOCAL_HOST,
-                 username=Constants.DEFAULT_USERNAME,
-                 password=Constants.DEFAULT_PASSWORD,
-                 is_https=Constants.DEFAULT_HTTPS,
-                 verify_https=Constants.DEFAULT_VERIFY_HTTPS):
+    def __init__(
+        self,
+        host_url=Constants.DEFAULT_LOCAL_HOST,
+        username=Constants.DEFAULT_USERNAME,
+        password=Constants.DEFAULT_PASSWORD,
+        is_https=Constants.DEFAULT_HTTPS,
+        verify_https=Constants.DEFAULT_VERIFY_HTTPS,
+    ):
         """
         Initiate an instance with a default local ip (192.168.1.1)
         :param host_url: string - host url. Defaults to 192.168.1.1
@@ -28,16 +31,20 @@
         :param is_https: boolean - use https? Default is false
         :param verify_https: boolean - verify https? Default is true
         """
-        self.router = OpenWrtLuciRPC(host_url, username, password,
-                                     is_https, verify_https)
+        self.router = OpenWrtLuciRPC(
+            host_url, username, password, is_https, verify_https
+        )
 
     def is_logged_in(self):
         """Returns true if a token has been aquired"""
         return self.router.token is not None
 
-    def get_all_connected_devices(self,
-                                  only_reachable=Constants.DEFAULT_ONLY_REACH,
-                                  wlan_interfaces=Constants.DEFAULT_WLAN_IF):
+    def get_all_connected_devices(
+        self,
+        only_reachable=Constants.DEFAULT_ONLY_REACH,
+        wlan_interfaces=Constants.DEFAULT_WLAN_IF,
+    ):
         """Get details of all devices"""
         return self.router.get_all_connected_devices(
-            only_reachable=only_reachable, wlan_interfaces=wlan_interfaces)
+            only_reachable=only_reachable, wlan_interfaces=wlan_interfaces
+        )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openwrt-luci-rpc-1.1.16/openwrt_luci_rpc/utilities.py 
new/openwrt-luci-rpc-1.1.17/openwrt_luci_rpc/utilities.py
--- old/openwrt-luci-rpc-1.1.16/openwrt_luci_rpc/utilities.py   2023-03-09 
21:34:52.000000000 +0100
+++ new/openwrt-luci-rpc-1.1.17/openwrt_luci_rpc/utilities.py   2024-03-04 
17:10:04.000000000 +0100
@@ -29,8 +29,7 @@
                 if x['.type'] == 'host'
                 and 'mac' in x
                 and 'name' in x
-                and x['mac'].upper() == mac]
-
+                and str(x['mac']).upper().find(mac) != -1]
         if host:
             log.debug("DNS name lookup for mac {} "
                       "found {}".format(mac, host[0]['name']))
@@ -42,5 +41,5 @@
 def is_legacy_version(owrt_version):
     return (
         "snapshot" not in owrt_version.public and
-        owrt_version < version.parse("18.06")
+        version.parse("18.06") > owrt_version >= version.parse("15.06")
     )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openwrt-luci-rpc-1.1.16/openwrt_luci_rpc.egg-info/PKG-INFO 
new/openwrt-luci-rpc-1.1.17/openwrt_luci_rpc.egg-info/PKG-INFO
--- old/openwrt-luci-rpc-1.1.16/openwrt_luci_rpc.egg-info/PKG-INFO      
2023-03-09 21:34:56.000000000 +0100
+++ new/openwrt-luci-rpc-1.1.17/openwrt_luci_rpc.egg-info/PKG-INFO      
2024-03-04 17:10:15.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: openwrt-luci-rpc
-Version: 1.1.16
+Version: 1.1.17
 Summary: Module for interacting with OpenWrt Luci RPC interface
 Home-page: https://github.com/fbradyirl/openwrt-luci-rpc
 Author: Finbarr Brady
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openwrt-luci-rpc-1.1.16/openwrt_luci_rpc.egg-info/SOURCES.txt 
new/openwrt-luci-rpc-1.1.17/openwrt_luci_rpc.egg-info/SOURCES.txt
--- old/openwrt-luci-rpc-1.1.16/openwrt_luci_rpc.egg-info/SOURCES.txt   
2023-03-09 21:34:57.000000000 +0100
+++ new/openwrt-luci-rpc-1.1.17/openwrt_luci_rpc.egg-info/SOURCES.txt   
2024-03-04 17:10:15.000000000 +0100
@@ -31,5 +31,6 @@
 tests/test_openwrt_15.py
 tests/test_openwrt_17.py
 tests/test_openwrt_18.py
+tests/test_openwrt_60.py
 tests/test_openwrt_luci_rpc.py
 tests/test_version.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openwrt-luci-rpc-1.1.16/setup.cfg 
new/openwrt-luci-rpc-1.1.17/setup.cfg
--- old/openwrt-luci-rpc-1.1.16/setup.cfg       2023-03-09 21:34:57.081500800 
+0100
+++ new/openwrt-luci-rpc-1.1.17/setup.cfg       2024-03-04 17:10:15.299735000 
+0100
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 1.1.16
+current_version = 1.1.17
 commit = True
 tag = True
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openwrt-luci-rpc-1.1.16/setup.py 
new/openwrt-luci-rpc-1.1.17/setup.py
--- old/openwrt-luci-rpc-1.1.16/setup.py        2023-03-09 21:34:52.000000000 
+0100
+++ new/openwrt-luci-rpc-1.1.17/setup.py        2024-03-04 17:10:04.000000000 
+0100
@@ -3,42 +3,42 @@
 
 """The setup script."""
 
-from setuptools import setup, find_packages
+from setuptools import find_packages, setup
 
-with open('README.rst') as readme_file:
+with open("README.rst") as readme_file:
     readme = readme_file.read()
 
-with open('HISTORY.rst') as history_file:
+with open("HISTORY.rst") as history_file:
     history = history_file.read()
 
-requirements = ['Click>=6.0', 'requests>=2.21.0', 'packaging>=19.1']
+requirements = ["Click>=6.0", "requests>=2.21.0", "packaging>=19.1"]
 
-setup_requirements = [ ]
+setup_requirements = []
 
-test_requirements = [ ]
+test_requirements = []
 
 setup(
     author="Finbarr Brady",
-    author_email='fbrady...@github.io',
+    author_email="fbrady...@github.io",
     classifiers=[
-        'Development Status :: 2 - Pre-Alpha',
-        'Intended Audience :: Developers',
-        'License :: OSI Approved :: Apache Software License',
-        'Natural Language :: English',
-        'Programming Language :: Python :: 3.7',
+        "Development Status :: 2 - Pre-Alpha",
+        "Intended Audience :: Developers",
+        "License :: OSI Approved :: Apache Software License",
+        "Natural Language :: English",
+        "Programming Language :: Python :: 3.7",
     ],
     description="Module for interacting with OpenWrt Luci RPC interface",
     install_requires=requirements,
     license="Apache Software License 2.0",
-    long_description=readme + '\n\n' + history,
+    long_description=readme + "\n\n" + history,
     include_package_data=True,
-    keywords='openwrt-luci-rpc',
-    name='openwrt-luci-rpc',
-    packages=find_packages(include=['openwrt_luci_rpc']),
+    keywords="openwrt-luci-rpc",
+    name="openwrt-luci-rpc",
+    packages=find_packages(include=["openwrt_luci_rpc"]),
     setup_requires=setup_requirements,
-    test_suite='tests',
+    test_suite="tests",
     tests_require=test_requirements,
-    url='https://github.com/fbradyirl/openwrt-luci-rpc',
-    version='1.1.16',
+    url="https://github.com/fbradyirl/openwrt-luci-rpc";,
+    version="1.1.17",
     zip_safe=False,
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openwrt-luci-rpc-1.1.16/tests/test_openwrt_60.py 
new/openwrt-luci-rpc-1.1.17/tests/test_openwrt_60.py
--- old/openwrt-luci-rpc-1.1.16/tests/test_openwrt_60.py        1970-01-01 
01:00:00.000000000 +0100
+++ new/openwrt-luci-rpc-1.1.17/tests/test_openwrt_60.py        2024-03-04 
17:10:04.000000000 +0100
@@ -0,0 +1,78 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+"""Tests for `openwrt_luci_rpc` package."""
+
+
+import unittest
+
+from openwrt_luci_rpc import utilities
+
+
+class TestOpenwrtLuciRPC(unittest.TestCase):
+    """Tests for `openwrt_luci_rpc` package."""
+
+    def setUp(self):
+        """Set up test fixtures, if any."""
+
+    def tearDown(self):
+        """Tear down test fixtures, if any."""
+
+    def test_get_hostname_from_dhcp_mac_list_formating(self):
+        """Test if lower case list of MAC match with Upper case."""
+
+        data = [
+            {
+                ".name": "cfg07ee1",
+                ".type": "host",
+                "name": "imac-ethernet",
+                ".index": 4,
+                "mac": ["c8:2a:10:4a:10:dd"],
+                "dns": "1",
+                ".anonymous": True,
+                "ip": "192.168.1.124",
+            }
+        ]
+
+        data = utilities.get_hostname_from_dhcp(data, "C8:2A:10:4A:10:DD")
+        assert data is None
+
+    def test_get_hostname_from_dhcp_mac_string_formating(self):
+        """Test if lower case string of MAC match with Upper case."""
+
+        data = [
+            {
+                ".name": "cfg07ee1",
+                ".type": "host",
+                "name": "imac-ethernet",
+                ".index": 4,
+                "mac": "c8:2a:10:4a:10:dd",
+                "dns": "1",
+                ".anonymous": True,
+                "ip": "192.168.1.124",
+            }
+        ]
+
+        data = utilities.get_hostname_from_dhcp(data, "C8:2A:10:4A:10:DD")
+        assert data is None
+
+    def test_get_hostname_from_dhcp_multiple_mac_string_formating(self):
+        """Test if lower case string of MAC match with Upper case of multi mac 
list."""  # noqa: E501python setup.py test
+
+        data = [
+            {
+                ".name": "cfg07ee1",
+                ".type": "host",
+                "name": "imac-ethernet",
+                ".index": 4,
+                "mac": {"c8:2a:10:4a:10:d9", "c8:2a:10:4a:10:dd"},
+                "dns": "1",
+                ".anonymous": True,
+                "ip": "192.168.1.124",
+            }
+        ]
+
+        data = utilities.get_hostname_from_dhcp(data, "C8:2A:10:4A:10:DD")
+        assert data is None
+        data = utilities.get_hostname_from_dhcp(data, "C8:2A:10:4A:10:D9")
+        assert data is None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openwrt-luci-rpc-1.1.16/tests/test_version.py 
new/openwrt-luci-rpc-1.1.17/tests/test_version.py
--- old/openwrt-luci-rpc-1.1.16/tests/test_version.py   2023-03-09 
21:34:52.000000000 +0100
+++ new/openwrt-luci-rpc-1.1.17/tests/test_version.py   2024-03-04 
17:10:04.000000000 +0100
@@ -5,9 +5,11 @@
 
 
 import unittest
-from openwrt_luci_rpc.utilities import is_legacy_version
+
 from packaging import version
 
+from openwrt_luci_rpc.utilities import is_legacy_version
+
 
 class TestOpenwrtLuciRPC(unittest.TestCase):
     """Tests for `openwrt_luci_rpc` package."""
@@ -21,8 +23,8 @@
     def test_is_legacy_version(self):
         """Test comparing versions works as expected."""
 
-        assert is_legacy_version(version.parse("15.05")) is True
-        assert is_legacy_version(version.parse("15.05.1")) is True
+        assert is_legacy_version(version.parse("15.05")) is False
+        assert is_legacy_version(version.parse("15.05.1")) is False
         assert is_legacy_version(version.parse("17.01")) is True
         assert is_legacy_version(version.parse("17.01.6")) is True
 

Reply via email to