~ubuntu-branches/ubuntu/lucid/ubuntuone-client/lucid-proposed

« back to all changes in this revision

Viewing changes to contrib/testing/testcase.py

  • Committer: Bazaar Package Importer
  • Author(s): Rodney Dawes
  • Date: 2009-09-28 18:15:00 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090928181500-jz7i72znd1nwap4r
Tags: 1.0.0-0ubuntu1
* New upstream release.
  - Limit log messages, file size, and rotate more often (LP: #435137)
  - Rotate oauth-login.log and cap the file size (LP: #445514)
  - Remove pycurl usage in favor of urllib and better errors (LP: #411029)
  - Save the syncdaemon settings for bw limiting (LP: #418882)
  - Fix NoSuchDatabase when pairing desktopcouch (LP: #438411)
  - Fix IOError when launching preferences window (LP: #441039)
  - Update icons to remove Ubuntu logo, better names (LP: #434886)
  - Use ngettext for the possibly singular notification (LP: #449269)
  - Only create Places bookmark when first authorizing (LP: #397749)
  - Don't always recreate the bookmark (LP: #401211)
  - Handle showing emblems better (LP: #440839)
  - Remove the System->Preferences menu item (LP: #443342)
  - Remove NotOnlineError usage (LP: #404550)
  - Set a default share name in the Nautilus sharing UI (LP: #369488)
  - Simplify some state handling (LP: #420354)

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# You should have received a copy of the GNU General Public License along
16
16
# with this program.  If not, see <http://www.gnu.org/licenses/>.
17
17
""" Base tests cases and test utilities """
 
18
from __future__ import with_statement
 
19
 
18
20
import dbus
19
21
from dbus.mainloop.glib import DBusGMainLoop
20
22
import logging
23
25
 
24
26
 
25
27
from ubuntuone.syncdaemon import (
 
28
    config,
26
29
    action_queue,
27
30
    event_queue,
28
31
    filesystem_manager as fs_manager,
187
190
            os.chmod(parent, 0755)
188
191
        os.makedirs(path)
189
192
 
 
193
    def setUp(self):
 
194
        TwistedTestCase.setUp(self)
 
195
        # invalidate the current config
 
196
        config_file = os.path.join(self.mktemp('config'), 'syncdaemon.conf')
 
197
        # fake a very basic config file with sane defaults for the tests
 
198
        with open(config_file, 'w') as fp:
 
199
            fp.write('[bandwidth_throttling]\n')
 
200
            fp.write('on = False\n')
 
201
            fp.write('read_limit = -1\n')
 
202
            fp.write('write_limit = -1\n')
 
203
        config._user_config = None
 
204
        config.get_user_config(config_file=config_file)
 
205
 
190
206
    def tearDown(self):
191
207
        """ cleanup the temp dir. """
 
208
        # invalidate the current config
 
209
        config._user_config = None
 
210
        config.get_user_config()
192
211
        if hasattr(self, '__root'):
193
212
            self.rmtree(self.__root)
194
213
        return TwistedTestCase.tearDown(self)