Mercurial > p > roundup > code
comparison test/test_indexer.py @ 3078:2fee36128471
Fix test to account for changed interface to find().
| author | Johannes Gijsbers <jlgijsbers@users.sourceforge.net> |
|---|---|
| date | Wed, 05 Jan 2005 22:28:32 +0000 |
| parents | 9c8de04a76b1 |
| children | a615cc230160 |
comparison
equal
deleted
inserted
replaced
| 3076:2817a4db901d | 3078:2fee36128471 |
|---|---|
| 16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | 16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | 17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | 18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 19 # SOFTWARE. | 19 # SOFTWARE. |
| 20 | 20 |
| 21 # $Id: test_indexer.py,v 1.5 2004-11-29 02:55:47 richard Exp $ | 21 # $Id: test_indexer.py,v 1.6 2005-01-05 22:28:32 jlgijsbers Exp $ |
| 22 | 22 |
| 23 import os, unittest, shutil | 23 import os, unittest, shutil |
| 24 | 24 |
| 25 from roundup.backends.indexer_dbm import Indexer | 25 from roundup.backends.indexer_dbm import Indexer |
| 26 | 26 |
| 37 self.dex.add_text('testing1', 'a the hello world') | 37 self.dex.add_text('testing1', 'a the hello world') |
| 38 self.assertEqual(self.dex.words, {'HELLO': {1: 1}, 'WORLD': {1: 1}}) | 38 self.assertEqual(self.dex.words, {'HELLO': {1: 1}, 'WORLD': {1: 1}}) |
| 39 self.dex.add_text('testing2', 'blah blah the world') | 39 self.dex.add_text('testing2', 'blah blah the world') |
| 40 self.assertEqual(self.dex.words, {'BLAH': {2: 2}, 'HELLO': {1: 1}, | 40 self.assertEqual(self.dex.words, {'BLAH': {2: 2}, 'HELLO': {1: 1}, |
| 41 'WORLD': {2: 1, 1: 1}}) | 41 'WORLD': {2: 1, 1: 1}}) |
| 42 self.assertEqual(self.dex.find(['world']), {2: 'testing2', | 42 self.assertEqual(self.dex.find(['world']), ['testing1', |
| 43 1: 'testing1'}) | 43 'testing2']) |
| 44 self.assertEqual(self.dex.find(['blah']), {2: 'testing2'}) | 44 self.assertEqual(self.dex.find(['blah']), ['testing2']) |
| 45 self.assertEqual(self.dex.find(['blah', 'hello']), {}) | 45 self.assertEqual(self.dex.find(['blah', 'hello']), []) |
| 46 self.dex.save_index() | 46 self.dex.save_index() |
| 47 | 47 |
| 48 def tearDown(self): | 48 def tearDown(self): |
| 49 shutil.rmtree('test-index') | 49 shutil.rmtree('test-index') |
| 50 | 50 |
