~launchpad-results/launchpad-results/trunk

« back to all changes in this revision

Viewing changes to lib/lpresults/repository/testing/fakes.py

  • Committer: Marc Tardif
  • Date: 2011-08-09 15:46:45 UTC
  • Revision ID: marc.tardif@canonical.com-20110809154645-i151emhk6onjggx5
Added hardware for systems and system units.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2010-2011 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
__metaclass__ = type
 
5
 
 
6
__all__ = [
 
7
    "FakeFactory",
 
8
    "FakeTimeoutCall",
 
9
    "FakeTransport",
 
10
    ]
 
11
 
 
12
from lpresults.repository.prober import ProberFactoryRedirect
 
13
 
 
14
 
 
15
class FakeFactory(ProberFactoryRedirect):
 
16
 
 
17
    redirectedTo = None
 
18
 
 
19
    def redirect(self, url):
 
20
        self.redirectedTo = url
 
21
 
 
22
 
 
23
class FakeTimeoutCall:
 
24
 
 
25
    resetCalled = False
 
26
 
 
27
    def reset(self, seconds):
 
28
        self.resetCalled = True
 
29
 
 
30
 
 
31
class FakeTransport:
 
32
 
 
33
    disconnecting = False
 
34
 
 
35
    def loseConnection(self):
 
36
        self.disconnecting = True
 
37
 
 
38
    def write(self, text):
 
39
        pass