Commit 237bf2f2a686b38d8f629a9023264fcd27856e2d
1 parent
aacad0f4
Exists in
master
and in
1 other branch
Improved data tests.
Showing
10 changed files
with
27 additions
and
29 deletions
Show diff stats
src/tests/data_tests.py
| ... | ... | @@ -71,13 +71,13 @@ class PopconXapianIndexTests(unittest2.TestCase): |
| 71 | 71 | |
| 72 | 72 | def test_reindex(self): |
| 73 | 73 | # force reindex with no clustering |
| 74 | - self.cfg.index_mode = "10" | |
| 74 | + self.cfg.index_mode = "reindex" | |
| 75 | 75 | pxi = PopconXapianIndex(self.cfg) |
| 76 | 76 | self.assertEqual(pxi.get_metadata("old"),"") |
| 77 | 77 | |
| 78 | 78 | def test_clustering(self): |
| 79 | 79 | # force reindex with clustering |
| 80 | - self.cfg.index_mode = "11" | |
| 80 | + self.cfg.index_mode = "cluster" | |
| 81 | 81 | pxi = PopconXapianIndex(self.cfg) |
| 82 | 82 | self.assertEqual(pxi.source_dir,self.cfg.clusters_dir) |
| 83 | 83 | all_submissions = [submissions for (root, dirs, submissions) in |
| ... | ... | @@ -96,8 +96,12 @@ class PopconXapianIndexTests(unittest2.TestCase): |
| 96 | 96 | all_submissions])) |
| 97 | 97 | |
| 98 | 98 | def test_recluster(self): |
| 99 | - pxi = PopconXapianIndex(self.cfg,1,1) | |
| 100 | - | |
| 99 | + # force reindexing and clustering | |
| 100 | + self.cfg.index_mode = "recluster" | |
| 101 | + self.cfg.k_medoids = 2 | |
| 102 | + pxi = PopconXapianIndex(self.cfg) | |
| 103 | + self.assertEqual(pxi.source_dir,self.cfg.clusters_dir) | |
| 104 | + self.assertEqual(pxi.get_doccount(),2) | |
| 101 | 105 | |
| 102 | 106 | if __name__ == '__main__': |
| 103 | 107 | unittest2.main() | ... | ... |
src/tests/test_data/popcon_dir/test_popcon_0
| 1 | 1 | POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_0 ARCH:i386 POPCONVER:1.52 |
| 2 | -1309407475 1303670994 perl-base /usr/bin/perl | |
| 3 | -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so | |
| 4 | -1309407450 1303670973 libc6 /lib/ld-2.11.2.so | |
| 2 | +1309407475 1303670994 gimp /usr/bin/perl | |
| 3 | +1309407451 1303670982 inkscape /lib/i686/cmov/libc-2.11.2.so | |
| 4 | +1309407450 1303670973 imagination /lib/ld-2.11.2.so | |
| 5 | 5 | 1309407434 1295654294 dash /bin/dash |
| 6 | 6 | 0 0 libusbmuxd1 <NOFILES> |
| 7 | 7 | END-POPULARITY-CONTEST-0 TIME:1309407492 | ... | ... |
src/tests/test_data/popcon_dir/test_popcon_1
| 1 | 1 | POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_1 ARCH:i386 POPCONVER:1.52 |
| 2 | -1309407475 1303670994 perl-base /usr/bin/perl | |
| 3 | -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so | |
| 4 | -1309407450 1303670973 libc6 /lib/ld-2.11.2.so | |
| 2 | +1309407475 1303670994 gimp /usr/bin/perl | |
| 5 | 3 | 1309407434 1295654294 dash /bin/dash |
| 6 | 4 | 0 0 libusbmuxd1 <NOFILES> |
| 7 | 5 | END-POPULARITY-CONTEST-0 TIME:1309407492 | ... | ... |
src/tests/test_data/popcon_dir/test_popcon_2
| 1 | 1 | POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_2 ARCH:i386 POPCONVER:1.52 |
| 2 | -1309407475 1303670994 perl-base /usr/bin/perl | |
| 3 | -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so | |
| 2 | +1309407475 1303670994 iceweasel /usr/bin/perl | |
| 3 | +1309407451 1303670982 python /lib/i686/cmov/libc-2.11.2.so | |
| 4 | 4 | 1309407450 1303670973 libc6 /lib/ld-2.11.2.so |
| 5 | 5 | 1309407434 1295654294 dash /bin/dash |
| 6 | 6 | 0 0 libusbmuxd1 <NOFILES> | ... | ... |
src/tests/test_data/popcon_dir/test_popcon_3
| 1 | 1 | POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_3 ARCH:i386 POPCONVER:1.52 |
| 2 | -1309407475 1303670994 perl-base /usr/bin/perl | |
| 3 | -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so | |
| 2 | +1309407475 1303670994 eog /usr/bin/perl | |
| 3 | +1309407451 1303670982 nautilus /lib/i686/cmov/libc-2.11.2.so | |
| 4 | 4 | 1309407450 1303670973 libc6 /lib/ld-2.11.2.so |
| 5 | -1309407434 1295654294 dash /bin/dash | |
| 6 | 5 | 0 0 libusbmuxd1 <NOFILES> |
| 7 | 6 | END-POPULARITY-CONTEST-0 TIME:1309407492 | ... | ... |
src/tests/test_data/popcon_dir/test_popcon_4
| 1 | 1 | POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_4 ARCH:i386 POPCONVER:1.52 |
| 2 | -1309407475 1303670994 perl-base /usr/bin/perl | |
| 3 | -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so | |
| 2 | +1309407475 1303670994 konqueror /usr/bin/perl | |
| 3 | +1309407451 1303670982 kedit /lib/i686/cmov/libc-2.11.2.so | |
| 4 | 4 | 1309407450 1303670973 libc6 /lib/ld-2.11.2.so |
| 5 | -1309407434 1295654294 dash /bin/dash | |
| 6 | 5 | 0 0 libusbmuxd1 <NOFILES> |
| 7 | 6 | END-POPULARITY-CONTEST-0 TIME:1309407492 | ... | ... |
src/tests/test_data/popcon_dir/test_popcon_5
| 1 | 1 | POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_5 ARCH:i386 POPCONVER:1.52 |
| 2 | -1309407475 1303670994 perl-base /usr/bin/perl | |
| 3 | -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so | |
| 4 | -1309407450 1303670973 libc6 /lib/ld-2.11.2.so | |
| 2 | +1309407475 1303670994 konqueror /usr/bin/perl | |
| 5 | 3 | 1309407434 1295654294 dash /bin/dash |
| 6 | 4 | 0 0 libusbmuxd1 <NOFILES> |
| 7 | 5 | END-POPULARITY-CONTEST-0 TIME:1309407492 | ... | ... |
src/tests/test_data/popcon_dir/test_popcon_6
| 1 | 1 | POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_6 ARCH:i386 POPCONVER:1.52 |
| 2 | 2 | 1309407475 1303670994 perl-base /usr/bin/perl |
| 3 | -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so | |
| 4 | -1309407450 1303670973 libc6 /lib/ld-2.11.2.so | |
| 3 | +1309407451 1303670982 eog /lib/i686/cmov/libc-2.11.2.so | |
| 4 | +1309407450 1303670973 nautilus /lib/ld-2.11.2.so | |
| 5 | 5 | 1309407434 1295654294 dash /bin/dash |
| 6 | 6 | 0 0 libusbmuxd1 <NOFILES> |
| 7 | 7 | END-POPULARITY-CONTEST-0 TIME:1309407492 | ... | ... |
src/tests/test_data/popcon_dir/test_popcon_7
| 1 | 1 | POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_7 ARCH:i386 POPCONVER:1.52 |
| 2 | -1309407475 1303670994 perl-base /usr/bin/perl | |
| 3 | -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so | |
| 4 | -1309407450 1303670973 libc6 /lib/ld-2.11.2.so | |
| 2 | +1309407475 1303670994 apticron /usr/bin/perl | |
| 3 | +1309407451 1303670982 aptitude /lib/i686/cmov/libc-2.11.2.so | |
| 4 | +1309407450 1303670973 apt /lib/ld-2.11.2.so | |
| 5 | 5 | 1309407434 1295654294 dash /bin/dash |
| 6 | 6 | 0 0 libusbmuxd1 <NOFILES> |
| 7 | 7 | END-POPULARITY-CONTEST-0 TIME:1309407492 | ... | ... |
src/tests/test_data/popcon_dir/test_popcon_8
| 1 | 1 | POPULARITY-CONTEST-0 TIME:1309407492 ID:8b44fcdbcf676e711a153d5db0test_8 ARCH:i386 POPCONVER:1.52 |
| 2 | -1309407475 1303670994 perl-base /usr/bin/perl | |
| 3 | -1309407451 1303670982 libc6-i686 /lib/i686/cmov/libc-2.11.2.so | |
| 4 | -1309407450 1303670973 libc6 /lib/ld-2.11.2.so | |
| 2 | +1309407475 1303670994 apticron /usr/bin/perl | |
| 3 | +1309407451 1303670982 eog /lib/i686/cmov/libc-2.11.2.so | |
| 4 | +1309407450 1303670973 nautilus /lib/ld-2.11.2.so | |
| 5 | 5 | 1309407434 1295654294 dash /bin/dash |
| 6 | 6 | 0 0 libusbmuxd1 <NOFILES> |
| 7 | 7 | END-POPULARITY-CONTEST-0 TIME:1309407492 | ... | ... |