Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_log_userhome(self):
self.config.set('general', 'log.file', '~/bugwarrior.log')
self.assertEqual(
config.fix_logging_path(self.config, 'general'),
'bugwarrior.log',
)
def test_log_absolute_path(self):
filename = os.path.join(os.path.expandvars('$HOME'), 'bugwarrior.log')
self.config.set('general', 'log.file', filename)
self.assertEqual(
config.fix_logging_path(self.config, 'general'),
'bugwarrior.log',
)
def test_log_envvar(self):
self.config.set('general', 'log.file', '$HOME/bugwarrior.log')
self.assertEqual(
config.fix_logging_path(self.config, 'general'),
'bugwarrior.log',
)
def test_log_stdout(self):
self.assertIsNone(config.fix_logging_path(self.config, 'general'))
def test_log_relative_path(self):
self.config.set('general', 'log.file', 'bugwarrior.log')
self.assertEqual(
config.fix_logging_path(self.config, 'general'),
'bugwarrior.log',
)