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_aslist(self):
self.assertEqual(
config.aslist('project_bar,project_baz'),
['project_bar', 'project_baz']
)
def test_asbool(self):
self.assertEqual(config.asbool('True'), True)
self.assertEqual(config.asbool('False'), False)
def test_echo(self):
self.assertEqual(config.oracle_eval("echo fööbår"), "fööbår")
def setUp(self):
self.old_environ = os.environ.copy()
self.tempdir = tempfile.mkdtemp(prefix='bugwarrior')
# Create temporary config files.
self.taskrc = os.path.join(self.tempdir, '.taskrc')
self.lists_path = os.path.join(self.tempdir, 'lists')
os.mkdir(self.lists_path)
with open(self.taskrc, 'w+') as fout:
fout.write('data.location=%s\n' % self.lists_path)
# Configure environment.
os.environ['HOME'] = self.tempdir
os.environ.pop(config.BUGWARRIORRC, None)
os.environ.pop('TASKRC', None)
os.environ.pop('XDG_CONFIG_HOME', None)
os.environ.pop('XDG_CONFIG_DIRS', None)
def test_asint(self):
self.assertEqual(config.asint(''), None)
self.assertEqual(config.asint('42'), 42)