~mikemc/ubuntuone-client/fix-dummy-sync-menu

« back to all changes in this revision

Viewing changes to tests/syncdaemon/test_sync.py

  • Committer: mike.mccracken at canonical
  • Date: 2012-09-26 06:43:37 UTC
  • mfrom: (1320.2.1 ubuntuone-client)
  • Revision ID: mike.mccracken@canonical.com-20120926064337-t2vg07w95wwsi52g
merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- coding: utf-8 -*-
2
2
#
3
 
# Author: Guillermo Gonzalez <guillermo.gonzalez@canonical.com>
4
 
#
5
3
# Copyright 2009-2012 Canonical Ltd.
6
4
#
7
5
# This program is free software: you can redistribute it and/or modify it
1322
1320
        # patch HQ to don't hash the file
1323
1321
        self.main.hash_q.insert = lambda *a: None
1324
1322
 
1325
 
        # record the call
 
1323
        # record the calls
1326
1324
        called = []
1327
1325
        self.main.fs.add_to_move_limbo = lambda *a: called.append(a)
 
1326
        self.main.action_q.pathlock.fix_path = lambda *a: called.append(a)
1328
1327
 
1329
1328
        # create context and call
1330
1329
        key = FSKey(self.main.fs, path=somepath1)
1332
1331
                                      key=key, logger=None)
1333
1332
        parent_id = FSKey(self.main.fs, path=self.root)['node_id']
1334
1333
        ssmr.client_moved('some event', {}, somepath1, somepath2)
1335
 
        self.assertEqual(called, [('', 'node_id', parent_id, parent_id,
1336
 
                                   'bar', somepath1, somepath2)])
 
1334
        self.assertEqual(called[0], (tuple(somepath1.split(os.path.sep)),
 
1335
                                     tuple(somepath2.split(os.path.sep))))
 
1336
        self.assertEqual(called[1], ('', 'node_id', parent_id, parent_id,
 
1337
                                     'bar', somepath1, somepath2))
1337
1338
 
1338
1339
    def test_clean_move_limbo(self):
1339
1340
        """Clean the move limbo with what was called."""