Example #1
0
 def clear(self, is_subobject=False):
     """
     Reset this object.
     """
     utils.clear_from_fields(self,
                             self.get_fields(),
                             is_subobject=is_subobject)
Example #2
0
    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)
Example #3
0
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 == ""
Example #4
0
 def clear(self, is_subobject=False):
     """
     Reset this object.
     """
     utils.clear_from_fields(self, self.get_fields(), is_subobject=is_subobject)