Example #1
0
    def tearDown(self):
        if not self.stage:
            return

        if not os.path.exists(self.stage):
            return

        f = Files({})
        if not f.is_dir_empty(self.stage):
            f.empty_dir(self.stage)

        os.rmdir(self.stage)
Example #2
0
    def tearDown(self):
        f = Files({})
        dirs = [self.stage, self.source, self.alt['source']['empty'], self.default['stage']]
        for i in dirs:
            if not i:
                continue

            if not os.path.exists(i):
                continue

            if not f.is_dir_empty(i):
                f.empty_dir(i)
            os.rmdir(i)