Exemplo n.º 1
0
 def test_document_move_with_multiple_tags(self):
     scope = Scope(database=self._database)
     scope.add_tag(2)
     scope.add_tag(3)
     scope.add_tag(6)
     self.assertEqual(scope.get_concept_document_ids(), [])
     self.assertEqual(set(scope.get_concept_tag_ids()), {2, 3, 6})
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(scope.get_concept_only_document_ids(), [])
     self.assertEqual(set(scope.get_selection_only_tag_ids()), {1, 4, 5})
     scope.move_document(6)
     self.assertEqual(scope.get_concept_document_ids(), [6])
     self.assertEqual(set(scope.get_concept_tag_ids()), {2, 3, 6})
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(scope.get_concept_only_document_ids(), [6])
     self.assertEqual(set(scope.get_selection_only_tag_ids()), {1, 4, 5})
     scope.select_document(6)
     self.assertEqual(scope.get_concept_document_ids(), [6])
     self.assertEqual(set(scope.get_concept_tag_ids()), {2, 3, 6})
     self.assertEqual(scope.get_selection_document_ids(), [6])
     self.assertEqual(set(scope.get_selection_tag_ids()), {2, 3, 6})
     self.assertEqual(scope.get_concept_only_document_ids(), [])
     self.assertEqual(scope.get_selection_only_tag_ids(), [])
Exemplo n.º 2
0
 def test_document_creation_with_single_tag(self):
     scope = Scope(database=self._database)
     scope.add_tag(2)
     self.assertEqual(scope.get_concept_tag_ids(), [2])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_selection_only_tag_ids()),
                      {1, 3, 4, 5, 6})
     document = scope.create_document('main.py', 'python', '/tmp/main.py')
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 4, 5, document.id})
     self.assertEqual(scope.get_concept_tag_ids(), [2])
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 4, 5, document.id})
     self.assertEqual(set(scope.get_selection_only_tag_ids()),
                      {1, 3, 4, 5, 6})
     scope.select_document(document.id)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 4, 5, document.id})
     self.assertEqual(scope.get_concept_tag_ids(), [2])
     self.assertEqual(scope.get_selection_document_ids(), [document.id])
     self.assertEqual(scope.get_selection_tag_ids(), [2])
     self.assertEqual(set(scope.get_concept_only_document_ids()), {1, 4, 5})
     self.assertEqual(scope.get_selection_only_tag_ids(), [])
     scope.deselect_document(document.id)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 4, 5, document.id})
     self.assertEqual(scope.get_concept_tag_ids(), [2])
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 4, 5, document.id})
     self.assertEqual(set(scope.get_selection_only_tag_ids()),
                      {1, 3, 4, 5, 6})
     scope.remove_tag(2)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8, document.id})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8, document.id})
     self.assertEqual(set(scope.get_selection_only_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     scope.select_document(document.id)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8, document.id})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(), [document.id])
     self.assertEqual(scope.get_selection_tag_ids(), [2])
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8})
     self.assertEqual(scope.get_selection_only_tag_ids(), [2])
Exemplo n.º 3
0
 def test_document_clone_with_single_tag(self):
     scope = Scope(database=self._database)
     scope.add_tag(6)
     self.assertEqual(set(scope.get_concept_document_ids()), {4, 7})
     self.assertEqual(scope.get_concept_tag_ids(), [6])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_selection_only_tag_ids()),
                      {1, 2, 3, 4, 5})
     cloned_document = scope.clone_document(2)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {4, 7, cloned_document.id})
     self.assertEqual(scope.get_concept_tag_ids(), [6])
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {4, 7, cloned_document.id})
     self.assertEqual(set(scope.get_selection_only_tag_ids()),
                      {1, 2, 3, 4, 5})
     scope.remove_tag(6)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8, cloned_document.id})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8, cloned_document.id})
     self.assertEqual(set(scope.get_selection_only_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     scope.select_document(cloned_document.id)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8, cloned_document.id})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(),
                      [cloned_document.id])
     self.assertEqual(scope.get_selection_tag_ids(), [6])
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8})
     self.assertEqual(scope.get_selection_only_tag_ids(), [6])
Exemplo n.º 4
0
 def test_tag_creation_with_multiple_documents(self):
     scope = Scope(database=self._database)
     for document_id in [4, 6, 7, 8]:
         scope.select_document(document_id)
     tag = scope.create_tag('source')
     scope.add_tag(tag.id)
     self.assertEqual(set(scope.get_concept_document_ids()), {4, 6, 7, 8})
     self.assertEqual(scope.get_concept_tag_ids(), [tag.id])
     self.assertEqual(set(scope.get_selection_document_ids()), {4, 6, 7, 8})
     self.assertEqual(scope.get_selection_tag_ids(), [tag.id])
     self.assertEqual(scope.get_concept_only_document_ids(), [])
     self.assertEqual(scope.get_selection_only_tag_ids(), [])
Exemplo n.º 5
0
 def test_document_creation_without_tags(self):
     scope = Scope(database=self._database)
     document = scope.create_document('main.c', 'c', '/tmp/main.c')
     scope.select_document(document.id)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8, document.id})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(), [document.id])
     self.assertEqual(scope.get_selection_tag_ids(), [])
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8})
     self.assertEqual(scope.get_selection_only_tag_ids(), [])
Exemplo n.º 6
0
 def test_single_document_move_to_root(self):
     scope = Scope(database=self._database)
     scope.move_document(7)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8})
     self.assertEqual(set(scope.get_selection_only_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     scope.select_document(7)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(), [7])
     self.assertEqual(scope.get_selection_tag_ids(), [])
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 8})
     self.assertEqual(scope.get_selection_only_tag_ids(), [])
Exemplo n.º 7
0
 def test_tag_creation_with_single_document(self):
     scope = Scope(database=self._database)
     scope.select_document(4)
     tag = scope.create_tag('template')
     scope.add_tag(tag.id)
     self.assertEqual(scope.get_concept_document_ids(), [4])
     self.assertEqual(scope.get_concept_tag_ids(), [tag.id])
     self.assertEqual(scope.get_selection_document_ids(), [4])
     self.assertEqual(set(scope.get_selection_tag_ids()), {2, 6, tag.id})
     self.assertEqual(scope.get_concept_only_document_ids(), [])
     self.assertEqual(set(scope.get_selection_only_tag_ids()), {2, 6})
     tag_names = {2: 'python', 6: 'index', tag.id: 'template'}
     for tag in scope.get_selection_only_tags():
         self.assertEqual(tag.name, tag_names[tag.id])
Exemplo n.º 8
0
 def test_initial_scope(self):
     scope = Scope(database=self._database)
     concept_document_ids = scope.get_concept_document_ids()
     self.assertEqual(set(concept_document_ids), {1, 2, 3, 4, 5, 6, 7, 8})
     concept_documents = scope.get_concept_documents()
     for concept_document in concept_documents:
         self.assertIn(concept_document.id, sample_documents)
         self.assertEqual(concept_document.name,
                          sample_documents[concept_document.id]['name'])
         self.assertEqual(concept_document.type,
                          sample_documents[concept_document.id]['type'])
         self.assertEqual(concept_document.path,
                          sample_documents[concept_document.id]['path'])
     concept_tag_ids = scope.get_concept_tag_ids()
     self.assertEqual(concept_tag_ids, [])
     concept_tags = scope.get_concept_tags()
     self.assertEqual(concept_tags, [])
     selection_document_ids = scope.get_selection_document_ids()
     self.assertEqual(selection_document_ids, [])
     selection_documents = scope.get_selection_documents()
     self.assertEqual(selection_documents, [])
     selection_tag_ids = scope.get_selection_tag_ids()
     self.assertEqual(set(selection_tag_ids), {1, 2, 3, 4, 5, 6})
     selection_tags = scope.get_selection_tags()
     for selection_tag in selection_tags:
         self.assertIn(selection_tag.id, sample_tags)
         self.assertEqual(selection_tag.name, sample_tags[selection_tag.id])
     concept_only_document_ids = scope.get_concept_only_document_ids()
     self.assertEqual(set(concept_only_document_ids),
                      set(concept_document_ids))
     concept_only_documents = scope.get_concept_only_documents()
     for concept_only_document in concept_only_documents:
         self.assertIn(concept_only_document.id, sample_documents)
         self.assertEqual(
             concept_only_document.name,
             sample_documents[concept_only_document.id]['name'])
         self.assertEqual(
             concept_only_document.type,
             sample_documents[concept_only_document.id]['type'])
         self.assertEqual(
             concept_only_document.path,
             sample_documents[concept_only_document.id]['path'])
     selection_only_tag_ids = scope.get_selection_only_tag_ids()
     self.assertEqual(set(selection_only_tag_ids), {1, 2, 3, 4, 5, 6})
     selection_only_tags = scope.get_selection_only_tags()
     for selection_only_tag in selection_only_tags:
         self.assertIn(selection_only_tag.id, sample_tags)
         self.assertEqual(selection_only_tag.name,
                          sample_tags[selection_only_tag.id])
Exemplo n.º 9
0
 def test_document_clone_to_root(self):
     scope = Scope(database=self._database)
     cloned_document = scope.clone_document(7)
     self.assertNotEqual(cloned_document.id, 7)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8, cloned_document.id})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8, cloned_document.id})
     self.assertEqual(set(scope.get_selection_only_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     scope.select_document(cloned_document.id)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8, cloned_document.id})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(),
                      [cloned_document.id])
     self.assertEqual(scope.get_selection_tag_ids(), [])
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8})
     self.assertEqual(scope.get_selection_only_tag_ids(), [])
Exemplo n.º 10
0
 def test_document_creation_with_multiple_tags(self):
     scope = Scope(database=self._database)
     scope.add_tag(4)
     self.assertEqual(set(scope.get_concept_document_ids()), {3, 6})
     self.assertEqual(scope.get_concept_tag_ids(), [4])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_selection_only_tag_ids()),
                      {1, 2, 3, 5, 6})
     scope.add_tag(1)
     self.assertEqual(scope.get_concept_document_ids(), [3])
     self.assertEqual(set(scope.get_concept_tag_ids()), {1, 4})
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_selection_only_tag_ids()), {2, 3, 5, 6})
     scope.add_tag(2)
     self.assertEqual(scope.get_concept_document_ids(), [])
     self.assertEqual(set(scope.get_concept_tag_ids()), {1, 2, 4})
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_selection_only_tag_ids()), {3, 5, 6})
     document = scope.create_document('vm.pdf', 'pdf', '/tmp/vm.pdf')
     self.assertEqual(scope.get_concept_document_ids(), [document.id])
     self.assertEqual(set(scope.get_concept_tag_ids()), {1, 2, 4})
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(scope.get_concept_only_document_ids(), [document.id])
     self.assertEqual(set(scope.get_selection_only_tag_ids()), {3, 5, 6})
     scope.select_document(document.id)
     self.assertEqual(scope.get_concept_document_ids(), [document.id])
     self.assertEqual(set(scope.get_concept_tag_ids()), {1, 2, 4})
     self.assertEqual(scope.get_selection_document_ids(), [document.id])
     self.assertEqual(set(scope.get_selection_tag_ids()), {1, 2, 4})
     self.assertEqual(scope.get_concept_only_document_ids(), [])
     self.assertEqual(scope.get_selection_only_tag_ids(), [])
Exemplo n.º 11
0
 def test_document_copy_to_root(self):
     scope = Scope(database=self._database)
     scope.copy_document(7)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8})
     self.assertEqual(set(scope.get_selection_only_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     scope.select_document(7)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(), [7])
     self.assertEqual(set(scope.get_selection_tag_ids()), {3, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 8})
     self.assertEqual(set(scope.get_selection_only_tag_ids()), {3, 6})
     scope.add_tag(3)
     self.assertEqual(set(scope.get_concept_document_ids()), {2, 7, 8})
     self.assertEqual(scope.get_concept_tag_ids(), [3])
     self.assertEqual(scope.get_selection_document_ids(), [7])
     self.assertEqual(set(scope.get_selection_tag_ids()), {3, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()), {2, 8})
     self.assertEqual(scope.get_selection_only_tag_ids(), [6])
     scope.remove_tag(3)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(), [7])
     self.assertEqual(set(scope.get_selection_tag_ids()), {3, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 8})
     self.assertEqual(set(scope.get_selection_only_tag_ids()), {3, 6})
     scope.add_tag(6)
     self.assertEqual(set(scope.get_concept_document_ids()), {4, 7})
     self.assertEqual(scope.get_concept_tag_ids(), [6])
     self.assertEqual(scope.get_selection_document_ids(), [7])
     self.assertEqual(set(scope.get_selection_tag_ids()), {3, 6})
     self.assertEqual(scope.get_concept_only_document_ids(), [4])
     self.assertEqual(scope.get_selection_only_tag_ids(), [3])
     scope.remove_tag(6)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(), [7])
     self.assertEqual(set(scope.get_selection_tag_ids()), {3, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 8})
     self.assertEqual(set(scope.get_selection_only_tag_ids()), {3, 6})
Exemplo n.º 12
0
 def test_document_clone_with_multiple_tags(self):
     scope = Scope(database=self._database)
     scope.add_tag(2)
     scope.add_tag(3)
     scope.add_tag(6)
     self.assertEqual(scope.get_concept_document_ids(), [])
     self.assertEqual(set(scope.get_concept_tag_ids()), {2, 3, 6})
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(scope.get_concept_only_document_ids(), [])
     self.assertEqual(set(scope.get_selection_only_tag_ids()), {1, 4, 5})
     cloned_document = scope.clone_document(6)
     self.assertNotEqual(cloned_document.id, 6)
     self.assertEqual(scope.get_concept_document_ids(),
                      [cloned_document.id])
     self.assertEqual(set(scope.get_concept_tag_ids()), {2, 3, 6})
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(scope.get_concept_only_document_ids(),
                      [cloned_document.id])
     self.assertEqual(set(scope.get_selection_only_tag_ids()), {1, 4, 5})
     scope.select_document(cloned_document.id)
     self.assertEqual(scope.get_concept_document_ids(),
                      [cloned_document.id])
     self.assertEqual(set(scope.get_concept_tag_ids()), {2, 3, 6})
     self.assertEqual(scope.get_selection_document_ids(),
                      [cloned_document.id])
     self.assertEqual(set(scope.get_selection_tag_ids()), {2, 3, 6})
     self.assertEqual(scope.get_concept_only_document_ids(), [])
     self.assertEqual(scope.get_selection_only_tag_ids(), [])
     scope.remove_tag(3)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {4, cloned_document.id})
     self.assertEqual(set(scope.get_concept_tag_ids()), {2, 6})
     self.assertEqual(scope.get_selection_document_ids(),
                      [cloned_document.id])
     self.assertEqual(set(scope.get_selection_tag_ids()), {2, 3, 6})
     self.assertEqual(scope.get_concept_only_document_ids(), [4])
     self.assertEqual(scope.get_selection_only_tag_ids(), [3])
     scope.remove_tag(2)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {4, 7, cloned_document.id})
     self.assertEqual(set(scope.get_concept_tag_ids()), {6})
     self.assertEqual(scope.get_selection_document_ids(),
                      [cloned_document.id])
     self.assertEqual(set(scope.get_selection_tag_ids()), {2, 3, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()), {4, 7})
     self.assertEqual(set(scope.get_selection_only_tag_ids()), {2, 3})
     scope.remove_tag(6)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8, cloned_document.id})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(),
                      [cloned_document.id])
     self.assertEqual(set(scope.get_selection_tag_ids()), {2, 3, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8})
     self.assertEqual(set(scope.get_selection_only_tag_ids()), {2, 3, 6})
     scope.deselect_document(cloned_document.id)
     self.assertEqual(set(scope.get_concept_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8, cloned_document.id})
     self.assertEqual(scope.get_concept_tag_ids(), [])
     self.assertEqual(scope.get_selection_document_ids(), [])
     self.assertEqual(set(scope.get_selection_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     self.assertEqual(set(scope.get_concept_only_document_ids()),
                      {1, 2, 3, 4, 5, 6, 7, 8, cloned_document.id})
     self.assertEqual(set(scope.get_selection_only_tag_ids()),
                      {1, 2, 3, 4, 5, 6})
     document_counts = {1: 4, 2: 3 + 1, 3: 3 + 1, 4: 2, 5: 3, 6: 2 + 1}
     for tag_id, document_count in document_counts.items():
         scope.add_tag(tag_id)
         self.assertEqual(len(scope.get_concept_documents()),
                          document_count)
         scope.remove_tag(tag_id)