/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-ctl

  • Committer: Teddy Hogeborn
  • Date: 2019-03-13 21:34:27 UTC
  • Revision ID: teddy@recompile.se-20190313213427-qquhadrtu7i24erp
mandos-ctl: White space changes only

* mandos-ctl: Add empty lines where appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1269
1269
            def get_object(client_bus_name, path):
1270
1270
                self.assertEqual(client_bus_name, dbus_busname)
1271
1271
                return {
1272
 
                    # Note: "self" here is the TestCmd instance, not
1273
 
                    # the Bus instance, since this is a static method!
1274
1272
                    "/clients/foo": self.client,
1275
1273
                    "/clients/barbar": self.other_client,
1276
1274
                }[path]
1515
1513
        self.assertEqual(output, expected_output)
1516
1514
 
1517
1515
 
 
1516
class Unique(object):
 
1517
    """Class for objects which exist only to be unique objects, since
 
1518
unittest.mock.sentinel only exists in Python 3.3"""
 
1519
 
 
1520
 
1518
1521
class TestPropertyCmd(TestCmd):
1519
1522
    """Abstract class for tests of PropertyCmd classes"""
1520
1523
    def runTest(self):
1527
1530
            for clientpath in self.clients:
1528
1531
                client = self.bus.get_object(dbus_busname, clientpath)
1529
1532
                old_value = client.attributes[self.propname]
1530
 
                self.assertNotIsInstance(old_value, self.Unique)
1531
 
                client.attributes[self.propname] = self.Unique()
 
1533
                self.assertNotIsInstance(old_value, Unique)
 
1534
                client.attributes[self.propname] = Unique()
1532
1535
            self.run_command(value_to_set, self.clients)
1533
1536
            for clientpath in self.clients:
1534
1537
                client = self.bus.get_object(dbus_busname, clientpath)
1535
1538
                value = client.attributes[self.propname]
1536
 
                self.assertNotIsInstance(value, self.Unique)
 
1539
                self.assertNotIsInstance(value, Unique)
1537
1540
                self.assertEqual(value, value_to_get)
1538
 
 
1539
 
    class Unique(object):
1540
 
        """Class for objects which exist only to be unique objects,
1541
 
since unittest.mock.sentinel only exists in Python 3.3"""
1542
 
 
1543
1541
    def run_command(self, value, clients):
1544
1542
        self.command().run(clients, self.bus)
1545
1543