Merge pull request #594 from matrix-org/markjh/coverage

Add a test for TreeCache.__contains__
pull/597/head
Mark Haines 2016-02-22 16:02:06 +00:00
commit 4d14655c2b
2 changed files with 9 additions and 0 deletions

View File

@ -61,6 +61,9 @@ class CounterMetricTestCase(unittest.TestCase):
'vector{method="PUT"} 1',
])
# Check that passing too few values errors
self.assertRaises(ValueError, counter.inc)
class CallbackMetricTestCase(unittest.TestCase):

View File

@ -77,3 +77,9 @@ class TreeCacheTestCase(unittest.TestCase):
cache[("b",)] = "B"
cache.clear()
self.assertEquals(len(cache), 0)
def test_contains(self):
cache = TreeCache()
cache[("a",)] = "A"
self.assertTrue(("a",) in cache)
self.assertFalse(("b",) in cache)