~rmcbride/ubuntu/lucid/ubuntuone-client/fixucg

« back to all changes in this revision

Viewing changes to tests/syncdaemon/test_eq_inotify.py

  • Committer: Bazaar Package Importer
  • Author(s): Rodney Dawes
  • Date: 2009-08-26 12:15:00 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090826121500-rivjec5146epys62
Tags: 0.93.0-0ubuntu1
* New upstream release.
  - Fix crash with KeyError in __getitem__ (LP: #404934)
  - Fix fatal error constant occurrances (LP: #414635)
  - Fix ability to reauthorize (LP: #406897)
  - Get rid of animated icon, and false activity status (LP: #414925)
* Update Standards-Version to 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
582
582
        os.rename(fromdir, todir)
583
583
        return self._deferred
584
584
 
 
585
    def test_delete_inside_moving_directory(self):
 
586
        '''Test to assure that the DELETE signal has the correct path.'''
 
587
        # basedir
 
588
        basedir = os.path.join(self.root_dir, "basedir")
 
589
        os.mkdir(basedir)
 
590
        self.fs.create(path=basedir, share_id='', is_dir=True)
 
591
 
 
592
        # working stuff
 
593
        dir1 = os.path.join(basedir, "inside_d")
 
594
        dir2 = os.path.join(basedir, "new_d")
 
595
        fromfile = os.path.join(dir1, "test_f")
 
596
        tofile = os.path.join(dir2, "test_f")
 
597
        os.mkdir(dir1)
 
598
        open(fromfile, "w").close()
 
599
 
 
600
        should_events = [
 
601
            ("FS_DIR_MOVE", dir1, dir2),
 
602
            ("FS_FILE_DELETE", tofile),
 
603
        ]
 
604
        self.eq.subscribe(DynamicHitMe(should_events, self))
 
605
        self.eq.inotify_add_watch(self.root_dir)
 
606
        self.eq.inotify_add_watch(basedir)
 
607
        self.eq.inotify_add_watch(dir1)
 
608
 
 
609
        # generate the event
 
610
        os.rename(dir1, dir2)
 
611
        os.remove(tofile)
 
612
        return self._deferred
 
613
 
 
614
 
585
615
class FreezeTests(BaseTwisted):
586
616
    '''Test the freeze mechanism.'''
587
617