예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 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
예제 #4
0
 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
예제 #5
0
 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
예제 #6
0
 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
예제 #7
0
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())
예제 #8
0
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())
예제 #9
0
 def get_basic_terms(self):
     for term in AnnouncementEvent.get_basic_terms(self):
         yield term
     ticket = self.target
     yield ticket['component']
예제 #10
0
 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
예제 #11
0
 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
예제 #13
0
 def __init__(self, build, category):
     AnnouncementEvent.__init__(self, 'bitten', category, build)
예제 #14
0
 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
예제 #15
0
 def setUp(self):
     self.event = AnnouncementEvent('realm', 'category', 'target')
 def __init__(self, realm, category, target):
     AnnouncementEvent.__init__(self, realm, category, target)