def __init__(self, who, files, comments, isdir=0, links=None, revision=None, when=None, branch=None, category=None, revlink='', properties={}, repository='', project=''): self.who = who self.comments = comments self.isdir = isdir if links is None: links = [] self.links = links self.revision = util.none_or_str(revision) if when is None: when = util.now() self.when = when self.branch = util.none_or_str(branch) self.category = util.none_or_str(category) self.revlink = revlink self.properties = Properties() self.properties.update(properties, "Change") self.repository = repository self.project = project # keep a sorted list of the files, for easier display self.files = files[:] self.files.sort()
def test_int(self): self.assertEqual(util.none_or_str(199), "199")
def test_str(self): self.assertEqual(util.none_or_str("hi"), "hi")
def test_none(self): self.assertEqual(util.none_or_str(None), None)