1
# Copyright 2007 Canonical Ltd. All rights reserved.
3
"""Common helpers for supermirrorsftp tests."""
6
__all__ = ['AvatarTestCase']
11
from canonical.tests.test_twisted import TwistedTestCase
14
class AvatarTestCase(TwistedTestCase):
15
"""Base class for tests that need an SFTPOnlyAvatar with some basic sample
18
self.tmpdir = self.mktemp()
20
# A basic user dict, 'alice' is a member of no teams (aside from the
22
self.aliceUserDict = {
25
'teams': [{'id': 1, 'name': 'alice', 'initialBranches': []}],
28
# An slightly more complex user dict for a user, 'bob', who is also a
33
'teams': [{'id': 2, 'name': 'bob', 'initialBranches': []},
34
{'id': 3, 'name': 'test-team', 'initialBranches': []}],
38
shutil.rmtree(self.tmpdir)
40
# Remove test droppings in the current working directory from using
41
# twisted.trial.unittest.TestCase.mktemp outside the trial test runner.
42
tmpdir_root = self.tmpdir.split(os.sep, 1)[0]
43
shutil.rmtree(tmpdir_root)