From 237bf2f2a686b38d8f629a9023264fcd27856e2d Mon Sep 17 00:00:00 2001 From: Tássia Camões Araújo Date: Fri, 15 Jul 2011 05:20:21 -0300 Subject: [PATCH] Improved data tests. --- src/tests/data_tests.py | 12 ++++++++---- src/tests/test_data/popcon_dir/test_popcon_0 | 6 +++--- src/tests/test_data/popcon_dir/test_popcon_1 | 4 +--- src/tests/test_data/popcon_dir/test_popcon_2 | 4 ++-- src/tests/test_data/popcon_dir/test_popcon_3 | 5 ++--- src/tests/test_data/popcon_dir/test_popcon_4 | 5 ++--- src/tests/test_data/popcon_dir/test_popcon_5 | 4 +--- src/tests/test_data/popcon_dir/test_popcon_6 | 4 ++-- src/tests/test_data/popcon_dir/test_popcon_7 | 6 +++--- src/tests/test_data/popcon_dir/test_popcon_8 | 6 +++--- 10 files changed, 27 insertions(+), 29 deletions(-) diff --git a/src/tests/data_tests.py b/src/tests/data_tests.py index c1f6074..2c7e4df 100755 --- a/src/tests/data_tests.py +++ b/src/tests/data_tests.py @@ -71,13 +71,13 @@ class PopconXapianIndexTests(unittest2.TestCase): def test_reindex(self): # force reindex with no clustering - self.cfg.index_mode = "10" + self.cfg.index_mode = "reindex" pxi = PopconXapianIndex(self.cfg) self.assertEqual(pxi.get_metadata("old"),"") def test_clustering(self): # force reindex with clustering - self.cfg.index_mode = "11" + self.cfg.index_mode = "cluster" pxi = PopconXapianIndex(self.cfg) self.assertEqual(pxi.source_dir,self.cfg.clusters_dir) all_submissions = [submissions for (root, dirs, submissions) in @@ -96,8 +96,12 @@ class PopconXapianIndexTests(unittest2.TestCase): all_submissions])) def test_recluster(self): - pxi = PopconXapianIndex(self.cfg,1,1) - + # force reindexing and clustering + self.cfg.index_mode = "recluster" + self.cfg.k_medoids = 2 + pxi = PopconXapianIndex(self.cfg) + self.assertEqual(pxi.source_dir,self.cfg.clusters_dir) + self.assertEqual(pxi.get_doccount(),2) if __name__ == '__main__': unittest2.main() diff --git a/src/tests/test_data/popcon_dir/test_popcon_0 b/src/tests/test_data/popcon_dir/test_popcon_0 index 8fbb59b..1790b1b 100644 --- a/src/tests/test_data/popcon_dir/test_popcon_0 +++ b/src/tests/test_data/popcon_dir/test_popcon_0 @@ -1,7 +1,7 @@ POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_0 ARCH:i386 POPCONVER:1.52 -1309407475 1303670994 perl-base /usr/bin/perl -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so -1309407450 1303670973 libc6 /lib/ld-2.11.2.so +1309407475 1303670994 gimp /usr/bin/perl +1309407451 1303670982 inkscape /lib/i686/cmov/libc-2.11.2.so +1309407450 1303670973 imagination /lib/ld-2.11.2.so 1309407434 1295654294 dash /bin/dash 0 0 libusbmuxd1 END-POPULARITY-CONTEST-0 TIME:1309407492 diff --git a/src/tests/test_data/popcon_dir/test_popcon_1 b/src/tests/test_data/popcon_dir/test_popcon_1 index f0ca39e..4fd919c 100644 --- a/src/tests/test_data/popcon_dir/test_popcon_1 +++ b/src/tests/test_data/popcon_dir/test_popcon_1 @@ -1,7 +1,5 @@ POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_1 ARCH:i386 POPCONVER:1.52 -1309407475 1303670994 perl-base /usr/bin/perl -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so -1309407450 1303670973 libc6 /lib/ld-2.11.2.so +1309407475 1303670994 gimp /usr/bin/perl 1309407434 1295654294 dash /bin/dash 0 0 libusbmuxd1 END-POPULARITY-CONTEST-0 TIME:1309407492 diff --git a/src/tests/test_data/popcon_dir/test_popcon_2 b/src/tests/test_data/popcon_dir/test_popcon_2 index fd48e03..4eadd0b 100644 --- a/src/tests/test_data/popcon_dir/test_popcon_2 +++ b/src/tests/test_data/popcon_dir/test_popcon_2 @@ -1,6 +1,6 @@ POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_2 ARCH:i386 POPCONVER:1.52 -1309407475 1303670994 perl-base /usr/bin/perl -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so +1309407475 1303670994 iceweasel /usr/bin/perl +1309407451 1303670982 python /lib/i686/cmov/libc-2.11.2.so 1309407450 1303670973 libc6 /lib/ld-2.11.2.so 1309407434 1295654294 dash /bin/dash 0 0 libusbmuxd1 diff --git a/src/tests/test_data/popcon_dir/test_popcon_3 b/src/tests/test_data/popcon_dir/test_popcon_3 index 1e6f04c..f79fe67 100644 --- a/src/tests/test_data/popcon_dir/test_popcon_3 +++ b/src/tests/test_data/popcon_dir/test_popcon_3 @@ -1,7 +1,6 @@ POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_3 ARCH:i386 POPCONVER:1.52 -1309407475 1303670994 perl-base /usr/bin/perl -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so +1309407475 1303670994 eog /usr/bin/perl +1309407451 1303670982 nautilus /lib/i686/cmov/libc-2.11.2.so 1309407450 1303670973 libc6 /lib/ld-2.11.2.so -1309407434 1295654294 dash /bin/dash 0 0 libusbmuxd1 END-POPULARITY-CONTEST-0 TIME:1309407492 diff --git a/src/tests/test_data/popcon_dir/test_popcon_4 b/src/tests/test_data/popcon_dir/test_popcon_4 index 1cc6f13..217c44e 100644 --- a/src/tests/test_data/popcon_dir/test_popcon_4 +++ b/src/tests/test_data/popcon_dir/test_popcon_4 @@ -1,7 +1,6 @@ POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_4 ARCH:i386 POPCONVER:1.52 -1309407475 1303670994 perl-base /usr/bin/perl -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so +1309407475 1303670994 konqueror /usr/bin/perl +1309407451 1303670982 kedit /lib/i686/cmov/libc-2.11.2.so 1309407450 1303670973 libc6 /lib/ld-2.11.2.so -1309407434 1295654294 dash /bin/dash 0 0 libusbmuxd1 END-POPULARITY-CONTEST-0 TIME:1309407492 diff --git a/src/tests/test_data/popcon_dir/test_popcon_5 b/src/tests/test_data/popcon_dir/test_popcon_5 index 06569fc..79dc196 100644 --- a/src/tests/test_data/popcon_dir/test_popcon_5 +++ b/src/tests/test_data/popcon_dir/test_popcon_5 @@ -1,7 +1,5 @@ POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_5 ARCH:i386 POPCONVER:1.52 -1309407475 1303670994 perl-base /usr/bin/perl -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so -1309407450 1303670973 libc6 /lib/ld-2.11.2.so +1309407475 1303670994 konqueror /usr/bin/perl 1309407434 1295654294 dash /bin/dash 0 0 libusbmuxd1 END-POPULARITY-CONTEST-0 TIME:1309407492 diff --git a/src/tests/test_data/popcon_dir/test_popcon_6 b/src/tests/test_data/popcon_dir/test_popcon_6 index 79cb2ef..40883f6 100644 --- a/src/tests/test_data/popcon_dir/test_popcon_6 +++ b/src/tests/test_data/popcon_dir/test_popcon_6 @@ -1,7 +1,7 @@ POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_6 ARCH:i386 POPCONVER:1.52 1309407475 1303670994 perl-base /usr/bin/perl -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so -1309407450 1303670973 libc6 /lib/ld-2.11.2.so +1309407451 1303670982 eog /lib/i686/cmov/libc-2.11.2.so +1309407450 1303670973 nautilus /lib/ld-2.11.2.so 1309407434 1295654294 dash /bin/dash 0 0 libusbmuxd1 END-POPULARITY-CONTEST-0 TIME:1309407492 diff --git a/src/tests/test_data/popcon_dir/test_popcon_7 b/src/tests/test_data/popcon_dir/test_popcon_7 index e32e0bd..6b64161 100644 --- a/src/tests/test_data/popcon_dir/test_popcon_7 +++ b/src/tests/test_data/popcon_dir/test_popcon_7 @@ -1,7 +1,7 @@ POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_7 ARCH:i386 POPCONVER:1.52 -1309407475 1303670994 perl-base /usr/bin/perl -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so -1309407450 1303670973 libc6 /lib/ld-2.11.2.so +1309407475 1303670994 apticron /usr/bin/perl +1309407451 1303670982 aptitude /lib/i686/cmov/libc-2.11.2.so +1309407450 1303670973 apt /lib/ld-2.11.2.so 1309407434 1295654294 dash /bin/dash 0 0 libusbmuxd1 END-POPULARITY-CONTEST-0 TIME:1309407492 diff --git a/src/tests/test_data/popcon_dir/test_popcon_8 b/src/tests/test_data/popcon_dir/test_popcon_8 index 40109e7..9b8c504 100644 --- a/src/tests/test_data/popcon_dir/test_popcon_8 +++ b/src/tests/test_data/popcon_dir/test_popcon_8 @@ -1,7 +1,7 @@ POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_8 ARCH:i386 POPCONVER:1.52 -1309407475 1303670994 perl-base /usr/bin/perl -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so -1309407450 1303670973 libc6 /lib/ld-2.11.2.so +1309407475 1303670994 apticron /usr/bin/perl +1309407451 1303670982 eog /lib/i686/cmov/libc-2.11.2.so +1309407450 1303670973 nautilus /lib/ld-2.11.2.so 1309407434 1295654294 dash /bin/dash 0 0 libusbmuxd1 END-POPULARITY-CONTEST-0 TIME:1309407492 -- libgit2 0.21.2