diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-09-29 14:21:29 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-09-29 14:21:29 +0100 |
commit | febe4fdc0d1f1cfe902300b0b85bd990d88eef50 (patch) | |
tree | aecf5bc830df44b0ee818e9bbc63e7d1f8631154 /morphlib | |
parent | a2c4584418bf71c7f7ee04e333e8f53375104e63 (diff) | |
download | morph-febe4fdc0d1f1cfe902300b0b85bd990d88eef50.tar.gz |
Add trivial CacheDir.
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/__init__.py | 1 | ||||
-rw-r--r-- | morphlib/cachedir.py | 22 | ||||
-rw-r--r-- | morphlib/cachedir_tests.py | 30 |
3 files changed, 53 insertions, 0 deletions
diff --git a/morphlib/__init__.py b/morphlib/__init__.py index bd318978..6648dc83 100644 --- a/morphlib/__init__.py +++ b/morphlib/__init__.py @@ -21,6 +21,7 @@ __version__ = '0.0' import builder +import cachedir import execute import morphology import tempdir diff --git a/morphlib/cachedir.py b/morphlib/cachedir.py new file mode 100644 index 00000000..a8e8dec6 --- /dev/null +++ b/morphlib/cachedir.py @@ -0,0 +1,22 @@ +# Copyright (C) 2011 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +class CacheDir(object): + + '''Manage Baserock cached binaries.''' + + def __init__(self, dirname): + self.dirname = dirname diff --git a/morphlib/cachedir_tests.py b/morphlib/cachedir_tests.py new file mode 100644 index 00000000..2ceb01b6 --- /dev/null +++ b/morphlib/cachedir_tests.py @@ -0,0 +1,30 @@ +# Copyright (C) 2011 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +import unittest + +import morphlib + + +class CacheDirTests(unittest.TestCase): + + def setUp(self): + self.dirname = '/cache/dir' + self.cachedir = morphlib.cachedir.CacheDir(self.dirname) + + def test_sets_dirname_attribute(self): + self.assertEqual(self.cachedir.dirname, self.dirname) + |