def __init__(self, realm, category, target, comment=None, author=None, changes=None, attachment=None): AnnouncementEvent.__init__(self, realm, category, target) self.author = author self.comment = comment self.changes = changes or {} self.attachment = attachment
def __init__(self, realm, category, target, comment=None, author=None, changes={}, attachment=None): AnnouncementEvent.__init__(self, realm, category, target) self.author = author self.comment = comment self.changes = changes self.attachment = attachment
def __init__(self, realm, category, target, comment=None, author=None, version=None, timestamp=None, attachment=None): AnnouncementEvent.__init__(self, realm, category, target) self.author = author self.comment = comment self.version = version self.timestamp = timestamp self.attachment = attachment
def __init__(self, realm, category, target, comment=None, author=None, version=None, timestamp=None, remote_addr=None, attachment=None): AnnouncementEvent.__init__(self, realm, category, target) self.author = author self.comment = comment self.version = version self.timestamp = timestamp self.remote_addr = remote_addr self.attachment = attachment
def __init__(self, blog_post, category, url, blog_comment=None): AnnouncementEvent.__init__(self, 'blog', category, blog_post) if blog_comment: if 'comment deleted' == category: self.comment = blog_comment['comment'] self.author = blog_comment['author'] self.timestamp = blog_comment['time'] else: self.comment = blog_comment.comment self.author = blog_comment.author self.timestamp = blog_comment.time else: self.comment = blog_post.version_comment self.author = blog_post.version_author self.timestamp = blog_post.version_time self.remote_addr = url self.version = blog_post.version self.blog_post = blog_post self.blog_comment = blog_comment
class AnnouncementEventTestCase(unittest.TestCase): def setUp(self): self.event = AnnouncementEvent('realm', 'category', 'target') def test_init(self): # Examine properties of the initialized object. event = self.event event_props = [event.realm, event.category, event.target, event.author] self.assertEquals(event_props, ['realm', 'category', 'target', '']) def test_get_basic_terms(self): # Method doesn't accept any argument. self.assertRaises(TypeError, self.event.get_basic_terms, None) self.assertEquals(self.event.get_basic_terms(), ('realm', 'category')) def test_get_session_terms(self): # While having mandatory argument, return value is a constant. self.assertRaises(TypeError, self.event.get_session_terms) self.assertEquals(self.event.get_session_terms(None), tuple()) self.assertEquals(self.event.get_session_terms('anonymous'), tuple())
def get_basic_terms(self): for term in AnnouncementEvent.get_basic_terms(self): yield term ticket = self.target yield ticket['component']
def __init__(self, category, username, password=None, token=None): AnnouncementEvent.__init__(self, 'acct_mgr', category, None) self.username = username self.password = password self.token = token
def setUp(self): self.event = AnnouncementEvent('realm', 'category', 'target')
def __init__(self, realm, category, target, log): AnnouncementEvent.__init__(self, realm, category, target) self.log = log
def __init__(self, build, category): AnnouncementEvent.__init__(self, 'bitten', category, build)
def __init__(self, realm, category, target): AnnouncementEvent.__init__(self, realm, category, target)