diff --git a/dbusmock/templates/networkmanager.py b/dbusmock/templates/networkmanager.py index d629a8b7..5352a4e0 100644 --- a/dbusmock/templates/networkmanager.py +++ b/dbusmock/templates/networkmanager.py @@ -810,7 +810,7 @@ def SettingsGetConnectionByUuid(self, conn_uuid): settings = self.conn.GetSettings() if settings["connection"]["uuid"] == conn_uuid: return o - raise dbus.exceptions.DBusException(f"There was no connection with uuid {conn_uuid}") + raise dbus.exceptions.DBusException("No connection with the UUID was found.") def ConnectionUpdate(self, settings): diff --git a/tests/test_networkmanager.py b/tests/test_networkmanager.py index 23b54407..26414e2b 100644 --- a/tests/test_networkmanager.py +++ b/tests/test_networkmanager.py @@ -585,9 +585,8 @@ def test_get_conn_by_uuid(self): connectionPath = self.settings.AddConnection(settings) self.assertEqual(self.settings.GetConnectionByUuid(uuid), connectionPath) - fakeuuid = "123123123213213" - with self.assertRaisesRegex(dbus.exceptions.DBusException, f".*uuid.*{fakeuuid}$"): - self.settings.GetConnectionByUuid(fakeuuid) + with self.assertRaisesRegex(dbus.exceptions.DBusException, "No connection with the UUID was found."): + self.settings.GetConnectionByUuid("123123123213213") if __name__ == "__main__":