Skip to content

Commit d935872

Browse files
author
Xavier Grangier
committed
grangier#86 - add tests
1 parent af0eebe commit d935872

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

tests/configuration.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,21 @@
2020
See the License for the specific language governing permissions and
2121
limitations under the License.
2222
"""
23+
import os
24+
import tempfile
2325
import unittest
2426

25-
from goose.configuration import Configuration
27+
from goose import Goose
2628

2729

2830
class TestTempDir(unittest.TestCase):
2931

30-
def test_tmp_not_overwritten(self):
32+
def test_tmp_defaut(self):
33+
g = Goose()
34+
default_local_storage_path = os.path.join(tempfile.gettempdir(), 'goose')
35+
self.assertEquals(g.config.local_storage_path, default_local_storage_path)
36+
37+
def test_tmp_overwritten(self):
3138
path = '/this/directory/does/not/exist/i/assume/'
32-
config = Configuration()
33-
self.assertRaises(AttributeError, lambda: setattr(config, 'local_storage_path', path))
39+
g = Goose({'local_storage_path': path})
40+
self.assertEquals(g.config.local_storage_path, path)

0 commit comments

Comments
 (0)