[grilo] tests: updated GrlMetadataSource filter tests
- From: Victor Manuel Jaquez Leal <vjaquez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] tests: updated GrlMetadataSource filter tests
- Date: Fri, 22 Oct 2010 16:59:42 +0000 (UTC)
commit 4c9ead94b45328c570bf13d9a4692240674009c7
Author: Simón Pena <spenap gmail com>
Date: Mon Oct 4 19:19:01 2010 +0200
tests: updated GrlMetadataSource filter tests
Updated GrlMetadataSource filter tests so that they assert that
the aggregated length of the two lists returned (the one which
passes the check and the one which doesn't) equals to the original
key list.
Signed-off-by: Simón Pena <spenap gmail com>
tests/python/test_metadata_source.py | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/tests/python/test_metadata_source.py b/tests/python/test_metadata_source.py
index 27cf58a..67282cb 100644
--- a/tests/python/test_metadata_source.py
+++ b/tests/python/test_metadata_source.py
@@ -36,13 +36,25 @@ class TestMetadataSource(unittest.TestCase):
keys = self.metadata_source.slow_keys()
def test_filter_supported(self):
- keys = self.metadata_source.filter_supported([], True)
+ sources = self.registry.get_sources(False)
+ keys = self.registry.get_metadata_keys()
+ for source in sources:
+ supported, unsupported = source.filter_supported(keys, True)
+ self.assertEqual(len(supported) + len(unsupported), len(keys))
def test_filter_slow(self):
- keys = self.metadata_source.filter_slow([], True)
+ sources = self.registry.get_sources(False)
+ keys = self.registry.get_metadata_keys()
+ for source in sources:
+ fast, slow = source.filter_slow(keys, True)
+ self.assertEqual(len(fast) + len(slow), len(keys))
def test_filter_writable(self):
- keys = self.metadata_source.filter_writable([], True)
+ sources = self.registry.get_sources(False)
+ keys = self.registry.get_metadata_keys()
+ for source in sources:
+ writable, unwritable = source.filter_writable(keys, True)
+ self.assertEqual(len(writable) + len(unwritable), len(keys))
def test_key_depends(self):
key_id = self.registry.lookup_metadata_key(constants.KEY_ID)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]