def testDirectoryMethodsDirInfo(self): self.driver.add(DirInfoEvent(1, monitors.EventInfo( old_div(self.dir, "dir"), monitors.EventType.Create))) self.driver.add(DirInfoEvent(1, monitors.EventInfo( old_div(self.dir, "dir"), monitors.EventType.Modify))) self.driver.add(DirInfoEvent(1, monitors.EventInfo( old_div(self.dir, "dir"), monitors.EventType.Delete))) self.driver.run()
def testDirectoryInDirectory(self): self.driver.add( DirInfoEvent( 1, monitors.EventInfo(self.dir / "root" / "dir", monitors.EventType.Create))) self.driver.add( DirInfoEvent( 1, monitors.EventInfo(self.dir / "root" / "dir" / "dir", monitors.EventType.Create))) self.driver.run()
def testBasicAdd(self): self.driver.add( DirInfoEvent( 1, monitors.EventInfo(self.dir / "root" / "dirtimeout", monitors.EventType.Create))) self.driver.run()
def testWithSingleImport(self): f = self.dir / "root" / "file" self.client.files = {str(f): [str(f)]} self.driver.add(DirInfoEvent(0, monitors.EventInfo( self.dir / "root" / "file", monitors.EventType.Create))) self.driver.run() time.sleep(0.25)
def testWithMultiImport(self): f1 = str(self.dir / "root" / "file1") f2 = str(self.dir / "root" / "file2") f3 = str(self.dir / "root" / "file3") f4 = str(self.dir / "root" / "file4") self.client.files = {f1: [f1, f2, f3, f4]} self.client.setDirImportWait(1) self.driver.add(DirInfoEvent(0.0, monitors.EventInfo( f1, monitors.EventType.Create))) self.driver.add(DirInfoEvent(100, monitors.EventInfo( f2, monitors.EventType.Create))) self.driver.add(DirInfoEvent(200, monitors.EventInfo( f3, monitors.EventType.Create))) self.driver.add(DirInfoEvent(300, monitors.EventInfo( f4, monitors.EventType.Create))) time.sleep(1) self.driver.run()
def testDirectoryDoesntExistOnDelete(self): self.driver.add(DirInfoEvent(1, monitors.EventInfo( old_div(self.dir, "dir"), monitors.EventType.Delete))) self.driver.run() self.assertErrors()
def testDirectoryDoesntExistOnModify(self): self.driver.add(DirInfoEvent(1, monitors.EventInfo( self.dir / "dir", monitors.EventType.Modify))) self.driver.run() self.assertErrors()