diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-04-19 11:17:19 +0100 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-04-19 11:17:19 +0100 |
commit | 423087a8353989a483dbf2e0f309fccb53257e92 (patch) | |
tree | 24ea48c03f3e3fec4a6ebc86eac4bc2fd811e489 /tests | |
parent | b7591067ce22c4615a0ad1d32c04461fa6e9440d (diff) |
avahimock: make entry group indices more unique
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/twisted/avahimock.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/twisted/avahimock.py b/tests/twisted/avahimock.py index 48b6789..2c14be0 100755 --- a/tests/twisted/avahimock.py +++ b/tests/twisted/avahimock.py @@ -283,7 +283,12 @@ class Avahi(dbus.service.Object): in_signature='', out_signature='o', sender_keyword='sender') def EntryGroupNew(self, sender): - index = len(self._entry_groups) + 1 + top = 0 + for eg in self._entry_groups: + if eg.index > top: + top = eg.index + + index = top + 1 entry_group = EntryGroup(sender, index, self._model) self._entry_groups.append(entry_group) return entry_group.object_path @@ -308,6 +313,8 @@ class EntryGroup(dbus.service.Object): dbus.service.Object.__init__(self, conn=bus, object_path=self.object_path) + self.index = index + self._state = 0 self.client = client self._model = model |