Ejemplo n.º 1
0
 def __repr__(self):
     """Generate a string representation."""
     return generate_string_from_data(
         self,
         skip=["passphrase"],
         add={"passphrase_set": bool(self.passphrase)}
     )
Ejemplo n.º 2
0
    def __repr__(self):
        """Describe the user for easy debugging.

        As there are many fields many of which might not be set,
        we only try to list the values that are set.

        :return: a string describing the UserData instance
        :rtype: str
        """
        return generate_string_from_data(
            self, skip=["password"], add={"password_set": bool(self.password)})
Ejemplo n.º 3
0
 def __repr__(self):
     return generate_string_from_data(
         obj=self,
         skip=["b"],
         add=["b_is_set={}".format(bool(self.b))]
     )
Ejemplo n.º 4
0
    def generate_string_from_invalid_type_test(self):
        with self.assertRaises(DBusStructureError) as cm:
            generate_string_from_data({"x": 1})

        self.assertEqual(str(cm.exception), "Fields are not defined at '__dbus_fields__'.")
Ejemplo n.º 5
0
 def __repr__(self):
     return generate_string_from_data(
         obj=self,
         skip=["b"],
         add={"b_is_set": bool(self.b)}
     )
Ejemplo n.º 6
0
 def __repr__(self):
     return generate_string_from_data(
         obj=self, skip=["b"], add=["b_is_set={}".format(bool(self.b))])