def tearDownModule():
    util.teardown()
    util.rmtree(os.environ['PIVT_HOME'], no_exist_ok=True)
    if 'PIVT_HOME' in os.environ:
        del(os.environ['PIVT_HOME'])

    ConfManager.load = orig_conf_load
Exemplo n.º 2
0
    def cleanup():
        """Clean up."""
        new_data_paths = util.new_data_dir.glob('*')

        for path in new_data_paths:
            if path.is_dir():
                util.rmtree(path)
            else:
                path.unlink()  # remove file
Exemplo n.º 3
0
    def test_no_trailing_backslash_in_dashboards_path(self):
        if not os.path.exists('dashboards'):
            os.makedirs('dashboards')

        with open('dashboards/derp.xml', 'w') as file:
            file.write('<dashboard>\n')
            file.write('\t<description>old_desc</description>\n')
            file.write('\t<something>else</something>\n')
            file.write('</dashboard>\n')

        util._update_last_pull_date('derp.xml', 'dashboards',
                                    '<description>new_desc</description>\n',
                                    None)

        expected = '<dashboard>\n\t<description>new_desc</description>\n\t<something>else</something>\n</dashboard>\n'

        with open('dashboards/derp.xml', 'r') as file:
            assert file.read() == expected

        util.rmtree('dashboards')
 def tearDown(self):
     util.rmtree(util.etc_dir)
def tearDownModule():
    util.teardown()
    util.rmtree(os.environ['PIVT_HOME'], no_exist_ok=True)
    if 'PIVT_HOME' in os.environ:
        del os.environ['PIVT_HOME']
 def tearDown(self):
     util.rmtree(util.data_dir, no_exist_ok=True)
 def setUp(self):
     self.collector = collect.Collector()
     util.rmtree(util.data_dir, no_exist_ok=True)
Exemplo n.º 8
0
 def tearDown(self):
     util.teardown()
     util.rmtree(util.var_dir, no_exist_ok=True)
Exemplo n.º 9
0
 def tearDown(self):
     util.rmtree(util.data_dir)