Esempio n. 1
0
    def test_get_value_missing_index(self):
        doc = {"indices": []}
        doc2 = {}

        item = CaseIndexItem(path=[PathNode(name="indices"), PathNode(name="RegCase")])
        col = CaseIndexExportColumn(item=item)

        self.assertEqual(col.get_value("domain", "docid", doc, []), EMPTY_VALUE)
        self.assertEqual(col.get_value("domain", "docid", doc2, []), EMPTY_VALUE)
Esempio n. 2
0
    def test_get_value_missing_index(self):
        doc = {
            'indices': []
        }
        doc2 = {}

        item = CaseIndexItem(path=[PathNode(name='indices'), PathNode(name='RegCase')])
        col = CaseIndexExportColumn(item=item)

        self.assertEqual(col.get_value('domain', 'docid', doc, []), EMPTY_VALUE)
        self.assertEqual(col.get_value('domain', 'docid', doc2, []), EMPTY_VALUE)
    def test_get_value_missing_index(self):
        doc = {'indices': []}
        doc2 = {}

        item = CaseIndexItem(
            path=[PathNode(name='indices'),
                  PathNode(name='RegCase')])
        col = CaseIndexExportColumn(item=item)

        self.assertEqual(col.get_value('domain', 'docid', doc, []), '')
        self.assertEqual(col.get_value('domain', 'docid', doc2, []), '')
Esempio n. 4
0
 def test_get_value(self):
     doc = {
         "indices": [
             {"referenced_id": "abc", "referenced_type": "RegCase"},
             {"referenced_id": "def", "referenced_type": "RegCase"},
             {"referenced_id": "notme", "referenced_type": "OtherCase"},
         ]
     }
     item = CaseIndexItem(path=[PathNode(name="indices"), PathNode(name="RegCase")])
     col = CaseIndexExportColumn(item=item)
     self.assertEqual(col.get_value("domain", "docid", doc, []), "abc def")
Esempio n. 5
0
 def test_get_value(self):
     doc = {
         'indices': [
             {
                 'referenced_id': 'abc',
                 'referenced_type': 'RegCase',
             },
             {
                 'referenced_id': 'def',
                 'referenced_type': 'RegCase',
             },
             {
                 'referenced_id': 'notme',
                 'referenced_type': 'OtherCase',
             },
         ]
     }
     item = CaseIndexItem(path=[PathNode(name='indices'), PathNode(name='RegCase')])
     col = CaseIndexExportColumn(item=item)
     self.assertEqual(col.get_value('domain', 'docid', doc, []), 'abc def')
Esempio n. 6
0
 def test_get_value(self):
     doc = {
         'indices': [
             {
                 'referenced_id': 'abc',
                 'referenced_type': 'RegCase',
             },
             {
                 'referenced_id': 'def',
                 'referenced_type': 'RegCase',
             },
             {
                 'referenced_id': 'notme',
                 'referenced_type': 'OtherCase',
             },
         ]
     }
     item = CaseIndexItem(path=[PathNode(name='indices'), PathNode(name='RegCase')])
     col = CaseIndexExportColumn(item=item)
     self.assertEqual(col.get_value('domain', 'docid', doc, []), 'abc def')