def test_logger(self): test_log_dir = utils.get_home_directory() + "logs/" test_log = log.get_logger("TEST") self.assertEqual("TEST", test_log.name) self.assertEqual(test_log.level, 0) os.unlink(test_log_dir + "test.log")
def setUp(self): home_dir = utils.get_home_directory() self.config = config.Config(home_dir + "pyhole.conf", "Pyhole")
def test_get_directory(self): new_dir = utils.get_home_directory() + "test_dir" self.assertFalse(os.path.exists(new_dir)) utils.get_directory("test_dir") self.assertTrue(os.path.exists(new_dir)) os.rmdir(new_dir)
def setUp(self): utils.write_file("tests", "pyhole_test_file", "foo") self.new_file = utils.get_home_directory() + "tests/pyhole_test_file"
def test_get_conf_file_path(self): conf_file_path = utils.get_conf_file_path() actual_conf_file_path = utils.get_home_directory() + "pyhole.conf" self.assertEqual(conf_file_path, actual_conf_file_path)
def test_get_home_directory(self): self.assertTrue(utils.get_home_directory().endswith("/.pyhole/"))