summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-08-14 13:12:13 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-08-14 13:12:13 -0400
commit42248f4465110ce4779745e6145075a0a9574c1a (patch)
treea047d3ebf28c779993c9a143138b08c93fb05e16 /testsuite
parenta9a7c84703eb7250012fd68af3e4ca77eae07029 (diff)
downloadbcfg2-42248f4465110ce4779745e6145075a0a9574c1a.tar.gz
bcfg2-42248f4465110ce4779745e6145075a0a9574c1a.tar.bz2
bcfg2-42248f4465110ce4779745e6145075a0a9574c1a.zip
Revert "doc: minor fixes"
Commit had more stuff in it than it should have. This reverts commit a9a7c84703eb7250012fd68af3e4ca77eae07029.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/Testsrc/Testlib/TestServer/TestCache.py54
1 files changed, 0 insertions, 54 deletions
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestCache.py b/testsuite/Testsrc/Testlib/TestServer/TestCache.py
deleted file mode 100644
index 7c26e52b8..000000000
--- a/testsuite/Testsrc/Testlib/TestServer/TestCache.py
+++ /dev/null
@@ -1,54 +0,0 @@
-import os
-import sys
-
-# add all parent testsuite directories to sys.path to allow (most)
-# relative imports in python 2.4
-path = os.path.dirname(__file__)
-while path != "/":
- if os.path.basename(path).lower().startswith("test"):
- sys.path.append(path)
- if os.path.basename(path) == "testsuite":
- break
- path = os.path.dirname(path)
-from common import *
-
-from Bcfg2.Server.Cache import *
-
-
-class TestCache(Bcfg2TestCase):
- def test_cache(self):
- md_cache = Cache("Metadata")
- md_cache['foo.example.com'] = 'foo metadata'
- md_cache['bar.example.com'] = 'bar metadata'
- self.assertItemsEqual(list(iter(md_cache)),
- ["foo.example.com", "bar.example.com"])
-
- probe_cache = Cache("Probes", "data")
- probe_cache['foo.example.com'] = 'foo probe data'
- probe_cache['bar.example.com'] = 'bar probe data'
- self.assertItemsEqual(list(iter(probe_cache)),
- ["foo.example.com", "bar.example.com"])
-
- md_cache.expire("foo.example.com")
- self.assertItemsEqual(list(iter(md_cache)), ["bar.example.com"])
- self.assertItemsEqual(list(iter(probe_cache)),
- ["foo.example.com", "bar.example.com"])
-
- probe_cache.expire("bar.example.com")
- self.assertItemsEqual(list(iter(md_cache)), ["bar.example.com"])
- self.assertItemsEqual(list(iter(probe_cache)),
- ["foo.example.com"])
-
- probe_cache['bar.example.com'] = 'bar probe data'
- self.assertItemsEqual(list(iter(md_cache)), ["bar.example.com"])
- self.assertItemsEqual(list(iter(probe_cache)),
- ["foo.example.com", "bar.example.com"])
-
- expire("bar.example.com")
- self.assertEqual(len(md_cache), 0)
- self.assertItemsEqual(list(iter(probe_cache)),
- ["foo.example.com"])
-
- probe_cache2 = Cache("Probes", "data")
- self.assertItemsEqual(list(iter(probe_cache)),
- list(iter(probe_cache2)))