def testRunCommand(self):

        from_path = os.path.join(os.path.dirname(utils.__file__), 'test_resources/utils/')
        to_path = os.path.join(os.path.dirname(utils.__file__), 'test_resources/utils_copy/')

        os.mkdir(to_path)

        c = CommandCopyDirectory(from_path, to_path)
        m = ThreadCommandManager()
        m.queue_empty.connect(self.commandFinished)
        m.addCommand(c)

        m.next()
        count = 0
        while not self._command_finished and count < 200:
            sleep(0.001)
            count += 1

        shutil.rmtree(to_path)
    def testAddCommand(self):

        c = CommandCopyDirectory('', '')
        m = ThreadCommandManager()
        m.addCommand(c)
 def testExecutetEmptyQueue(self):
     m = ThreadCommandManager()
     m.next()
     self.assertEqual(0, len(m._queue))