def clear(self, is_subobject=False): """ Reset this object. """ utils.clear_from_fields(self, self.get_fields(), is_subobject=is_subobject)
def clear(self, is_subobject=False): """ Reset this object. :param is_subobject: True if this is a subobject, otherwise the default is enough. """ utils.clear_from_fields(self, self.get_fields(), is_subobject=is_subobject)
def test_clear_from_fields(): # Arrange test_api = CobblerAPI() test_distro = Distro(test_api._collection_mgr) test_distro.name = "Test" # Pre Assert to check this works assert test_distro.name == "Test" # Act utils.clear_from_fields(test_distro, test_distro.get_fields()) # Assert assert test_distro.name == ""