Exemplo n.º 1
0
    def setUp(self):
        super(TestFeedSwift, self).setUp()
        self.swift_fixture = self.useFixture(SwiftFixture())
        self.useFixture(FeatureFixture({'librarian.swift.enabled': True}))
        transaction.commit()

        self.addCleanup(swift.connection_pool.clear)

        # Restart the Librarian so it picks up the OS_* environment
        # variables.
        LibrarianLayer.librarian_fixture.killTac()
        LibrarianLayer.librarian_fixture.setUp()

        # Add some files. These common sample files all have their
        # modification times set to the past so they will not be
        # considered potential in-progress uploads.
        the_past = time.time() - 25 * 60 * 60
        self.librarian_client = LibrarianClient()
        self.contents = [str(i) * i for i in range(1, 5)]
        self.lfa_ids = [
            self.add_file('file_{0}'.format(i), content, when=the_past)
            for i, content in enumerate(self.contents)
        ]
        self.lfas = [
            IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id)
            for lfa_id in self.lfa_ids
        ]
        self.lfcs = [lfa.content for lfa in self.lfas]
Exemplo n.º 2
0
 def setUp(self):
     super(TestSwiftFixture, self).setUp()
     self.swift_fixture = SwiftFixture()
     self.useFixture(self.swift_fixture)
Exemplo n.º 3
0
 def setUp(self):
     super(TestSwiftFixture, self).setUp()
     self.swift_fixture = SwiftFixture()
     self.useFixture(self.swift_fixture)
     self.factory = ObjectFactory()