diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-09-29 14:40:47 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-09-29 14:40:47 +0100 |
commit | ca50eed4c902a3454cf7210eeeb818f28d6e7e2a (patch) | |
tree | e47b8b237e1aaa3dee236633d279b8bff93ba439 /morphlib/cachedir_tests.py | |
parent | e8f1882ce8236081ba7a6cc716cff0754e8a438a (diff) | |
download | morph-ca50eed4c902a3454cf7210eeeb818f28d6e7e2a.tar.gz |
Add generation of filenames in the cache directory.
Diffstat (limited to 'morphlib/cachedir_tests.py')
-rw-r--r-- | morphlib/cachedir_tests.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/morphlib/cachedir_tests.py b/morphlib/cachedir_tests.py index 17fa6e0f..b9f7c80b 100644 --- a/morphlib/cachedir_tests.py +++ b/morphlib/cachedir_tests.py @@ -56,3 +56,34 @@ class CacheDirTests(unittest.TestCase): self.assertNotEqual(self.cachedir.key(dict_key_1), self.cachedir.key(dict_key_2)) + def test_returns_a_chunk_pathname_in_cache_directory(self): + dict_key = { + 'kind': 'chunk', + 'ref': 'DEADBEEF', + 'repo': 'git://git.baserock.org/hello/', + 'arch': 'armel', + } + pathname = self.cachedir.name(dict_key) + self.assert_(pathname.startswith(self.cachedir.dirname + '/')) + self.assert_(pathname.endswith('.chunk')) + + def test_returns_a_stratum_pathname_in_cache_directory(self): + dict_key = { + 'kind': 'stratum', + 'ref': 'DEADBEEF', + 'repo': 'git://git.baserock.org/hello/', + 'arch': 'armel', + } + pathname = self.cachedir.name(dict_key) + self.assert_(pathname.startswith(self.cachedir.dirname + '/')) + self.assert_(pathname.endswith('.stratum')) + + def test_returns_a_valid_pathname_in_cache_directory(self): + dict_key = { + 'ref': 'DEADBEEF', + 'repo': 'git://git.baserock.org/hello/', + 'arch': 'armel', + } + pathname = self.cachedir.name(dict_key) + self.assert_(pathname.startswith(self.cachedir.dirname + '/')) + |