Exemple #1
0
    def test_view_categories(self):
        track = self._track_category('Good')
        doc1 = pjson.dumps(track._data)
        doc2 = pjson.dumps(track._data)

        track = self._track_category('Rock')
        doc3 = pjson.dumps(track._data)

        out = self.wrapper.mapPath('views/view-categories/map.js', doc1)
        self.assertEquals(out, '[[["Good",1]]]')

        out = self.wrapper.mapReducePath(
            'views/view-categories/map.js',
            'views/view-categories/reduce.js',
            [doc1, doc2, doc3])
        self.assertEquals(out, '[true,[3]]')
Exemple #2
0
 def test_view_mbtrackid(self):
     track = mappings.Track(name=u'track')
     track.fragments = [
         {
             'files': [],
             'chroma': {
                 'chromaprint': None,
                 'mbid': 'ABCD'
             }
         },
     ]
     doc = pjson.dumps(track._data)
     
     out = self.wrapper.mapPath('views/view-mbtrackid/map.js', doc)
     self.assertEquals(out, '[[["ABCD",1]]]')