/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

  • Committer: teddy at recompile
  • Date: 2020-01-12 01:53:04 UTC
  • Revision ID: teddy@recompile.se-20200112015304-gqif9w4pbyix8w6b
mandos-ctl: Fix minor bug in tests

Fix two tests, the last assert of which would always erroneously
succeed.  (No change in non-test code needed.)

* mandos-ctl (Test_dbus_python_adapter_SystemBus): In the
  test_call_method_handles_exception() method, fix check for
  dbus.ConnectFailed exception.
  (Test_pydbus_adapter_SystemBus): - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
import collections
79
79
import codecs
80
80
import unittest
81
 
import random
82
81
 
83
82
import dbus
84
83
import dbus.service
94
93
    __metaclass__ = type
95
94
    str = unicode
96
95
 
97
 
# Add collections.abc.Callable if it does not exist
98
 
try:
99
 
    collections.abc.Callable
100
 
except AttributeError:
101
 
    class abc:
102
 
        Callable = collections.Callable
103
 
    collections.abc = abc
104
 
    del abc
105
 
 
106
96
# Show warnings by default
107
97
if not sys.warnoptions:
108
98
    import warnings
1045
1035
        if self.checker_initiator_tag is not None:
1046
1036
            GLib.source_remove(self.checker_initiator_tag)
1047
1037
        self.checker_initiator_tag = GLib.timeout_add(
1048
 
            random.randrange(int(self.interval.total_seconds() * 1000
1049
 
                                 + 1)),
 
1038
            int(self.interval.total_seconds() * 1000),
1050
1039
            self.start_checker)
1051
1040
        # Schedule a disable() when 'timeout' has passed
1052
1041
        if self.disable_initiator_tag is not None:
2757
2746
        if command == 'getattr':
2758
2747
            attrname = request[1]
2759
2748
            if isinstance(client_object.__getattribute__(attrname),
2760
 
                          collections.abc.Callable):
 
2749
                          collections.Callable):
2761
2750
                parent_pipe.send(('function', ))
2762
2751
            else:
2763
2752
                parent_pipe.send((