~statik/+junk/statikbot

« back to all changes in this revision

Viewing changes to statikbot/testing/fakes.py

  • Committer: Elliot Murphy
  • Date: 2009-12-24 21:15:33 UTC
  • Revision ID: elliot@elliotmurphy.com-20091224211533-ncv2o6wgm0mve7od
Add some fake objects that represent launchpadlib objects for testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""Nobody realizes that some people expend tremendous energy merely to be
 
2
normal."""
 
3
 
 
4
# swiped from jml's code in launchpad
 
5
 
 
6
class FakeBug(object):
 
7
    """Fake launchpadlib Bug object.
 
8
 
 
9
    Only used by the test suite.
 
10
    """
 
11
 
 
12
    def __init__(self, id, status='New', importance='Undecided'):
 
13
        self.id = id
 
14
        self.status = status
 
15
        self.importance = importance
 
16
 
 
17
class FakePerson(object):
 
18
    """Fake launchpadlib Person object.
 
19
 
 
20
    Only used by the test suite.
 
21
    """
 
22
    def __init__(self, name, jabber_ids):
 
23
        self.name = name
 
24
        self.jabber_ids = list(jabber_ids)
 
25
 
 
26
class FakeJabber(object):
 
27
    """Fake Jabber ID.
 
28
 
 
29
    Only used by the test suite.
 
30
    """
 
31
    def __init__(self, jid):
 
32
        self.jid = jid