From 7fb5b04bb4054f60cefc79efabcef07979628285 Mon Sep 17 00:00:00 2001 From: Kay Kurokawa Date: Fri, 30 Jun 2017 12:39:53 -0400 Subject: [PATCH] add directory encoding test in test_conf --- tests/unit/test_conf.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_conf.py b/tests/unit/test_conf.py index 2fce3e447..17dff30e2 100644 --- a/tests/unit/test_conf.py +++ b/tests/unit/test_conf.py @@ -1,7 +1,6 @@ import os from twisted.trial import unittest - from lbrynet import conf @@ -54,3 +53,11 @@ class SettingsTest(unittest.TestCase): self.assertEqual('cli_test_string', settings['test']) settings.set('test', 'runtime_takes_precedence', data_types=(conf.TYPE_RUNTIME,)) self.assertEqual('runtime_takes_precedence', settings['test']) + + def test_data_dir(self): + # check if these directories are returned as string and not unicode + # otherwise there will be problems when calling os.path.join on + # unicode directory names with string file names + self.assertEqual(str, type(conf.default_download_directory)) + self.assertEqual(str, type(conf.default_data_dir)) + self.assertEqual(str, type(conf.default_lbryum_dir))