Esempio n. 1
0
 def copy(self):
     option = self.__class__.__new__(self.__class__)
     set_attributes(option, {
         "short": self.short,
         "long": self.long,
         "positionals": [
             positional.copy() for positional in self.positionals
         ],
         "action": self.action,
         "help": self.help
     })
     return option
Esempio n. 2
0
 def test_set_attributes(self):
     object = TestObject()
     set_attributes(object, {"foo": "spam", "bar": "eggs"})
     self.assert_equal(object.foo, "spam")
     self.assert_equal(object.bar, "eggs")