Пример #1
0
    def test_first_pack_selector(self) -> None:
        selector = FirstPackSelector()
        selector.initialize()
        packs = list(selector.select(self.multi_pack))
        self.assertEqual(len(packs), 1)
        self.assertEqual(packs[0].pack_name, "1")

        # Test reverse selection.
        selector.initialize({"reverse_selection": True})
        packs = list(selector.select(self.multi_pack))
        self.assertEqual(len(packs), len(self.multi_pack.packs) - 1)
Пример #2
0
 def test_first_pack_selector(self) -> None:
     selector = FirstPackSelector()
     packs = list(selector.select(self.multi_pack))
     self.assertEqual(len(packs), 1)
     self.assertEqual(packs[0].meta.doc_id, "1")