~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/poppy/tests/test_twistedsftp.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-05-09 02:03:49 UTC
  • mfrom: (12990.2.1 rollback-12987)
  • Revision ID: launchpad@pqm.canonical.com-20110509020349-av7wi9hq7j9wa4nu
[rs=wgrant][rollback=12987] Roll back r12987. It makes poppy-sftp
 leak LoopingCalls,
 and relies on there being at least one SFTP session before the reaping.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
import os
9
9
import tempfile
 
10
import unittest
10
11
 
11
 
from canonical.testing.layers import ZopelessDatabaseLayer
12
12
from lp.poppy.twistedsftp import SFTPServer
13
13
from lp.services.sshserver.sftp import FileIsADirectory
14
14
from lp.testing import TestCase
16
16
 
17
17
class TestSFTPServer(TestCase):
18
18
 
19
 
    layer = ZopelessDatabaseLayer
20
 
 
21
19
    def setUp(self):
22
20
        self.fs_root = tempfile.mkdtemp()
23
21
        self.sftp_server = SFTPServer(None, self.fs_root)
62
60
            "File is a directory: '%s'" % dir_name,
63
61
            upload_file.writeChunk, 0, "This is a test")
64
62
 
65
 
    def test_gpghandler_job_setup(self):
66
 
        # Does the gpghandler job get setup correctly.
67
 
        self.assertIsNot(None, self.sftp_server._gpghandler_job)
68
 
        self.assertTrue(self.sftp_server._gpghandler_job.running)
69
 
 
70
 
        # It should be scheduled for every 12 hours.
71
 
        self.assertEqual(12 * 3600, self.sftp_server._gpghandler_job.interval)
 
63
def test_suite():
 
64
    return unittest.TestLoader().loadTestsFromName(__name__)