Skip to content

Commit

Permalink
NetworkManager template: Reword "UUID not found" error message
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpitt committed Jan 30, 2024
1 parent 6c28079 commit 901f8f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dbusmock/templates/networkmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
5 changes: 2 additions & 3 deletions tests/test_networkmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down

0 comments on commit 901f8f5

Please sign in to comment.