~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/testing/tests/test_fakelibrarian.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-08-27 16:05:50 UTC
  • mfrom: (11457.2.3 fakelibrarian-fixture)
  • Revision ID: launchpad@pqm.canonical.com-20100827160550-30vrwdktf17tb2mx
[r=julian-edwards][ui=none][no-qa] Make FakeLibrarian a fixture;
        ignore debugID parameter to create().

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
            getUtility(ILibrarianClient).addFile,
91
91
            name, wrong_length, StringIO(text), 'text/plain')
92
92
 
 
93
    def test_debugID_is_harmless(self):
 
94
        # addFile takes an argument debugID that doesn't do anything
 
95
        # observable.  We get a LibraryFileAlias regardless.
 
96
        alias_id = getUtility(ILibraryFileAliasSet).create(
 
97
            'txt.txt', 3, StringIO('txt'), 'text/plain', debugID='txt')
 
98
        self.assertNotEqual(None, alias_id)
 
99
 
93
100
 
94
101
class TestFakeLibrarian(LibraryAccessScenarioMixin, TestCaseWithFactory):
95
102
    """Test the supported interface subset on the fake librarian."""
98
105
 
99
106
    def setUp(self):
100
107
        super(TestFakeLibrarian, self).setUp()
101
 
        self.fake_librarian = FakeLibrarian()
102
 
        self.fake_librarian.installAsLibrarian()
103
 
 
104
 
    def tearDown(self):
105
 
        super(TestFakeLibrarian, self).tearDown()
106
 
        self.fake_librarian.uninstall()
 
108
        self.fake_librarian = self.installFixture(FakeLibrarian())
107
109
 
108
110
    def test_fake(self):
109
111
        self.assertTrue(verifyObject(ISynchronizer, self.fake_librarian))