Пример #1
0
 def test_search_nodes_by_value_and_property_in_list(self):
     new_properties = {'test': ['hello', 'world']}
     core.set_node_properties(self.neo4jdb, handle_id='1', new_properties=new_properties)
     result = core.search_nodes_by_value(self.neo4jdb, value='hel', prop='test')
     for node in result:
         self.assertEqual(node.get('test'), ['hello', 'world'])
         return
     self.assertTrue(False, 'Nothing found')
Пример #2
0
 def test_get_nodes_by_value_and_property_int(self):
     new_properties = {'test': 3}
     core.set_node_properties(self.neo4jdb, handle_id='1', new_properties=new_properties)
     result = core.get_nodes_by_value(self.neo4jdb, value=3, prop='test')
     for node in result:
         self.assertEqual(node.get('test'), 3)
         return
     self.assertTrue(False, 'Nothing found')
Пример #3
0
 def test_set_node_properties(self):
     new_properties = {'test': 'hello world'}
     core.set_node_properties(self.neo4jdb,
                              handle_id='1',
                              new_properties=new_properties)
     node = core.get_node(self.neo4jdb, handle_id='1')
     new_properties.update({'handle_id': '1'})
     self.assertEqual(node, new_properties)
Пример #4
0
    def test_search_nodes_by_value_and_property_in_list(self):
        new_properties = {'test': ['hello', 'world']}
        core.set_node_properties(self.neo4jdb, handle_id='1', new_properties=new_properties)
        result = core.search_nodes_by_value(self.neo4jdb, value='hel', prop='test')

        all_results = [r for r in result]
        self.assertEqual(len(all_results), 1)
        node = all_results[0]
        self.assertEqual(node.get('test'), ['hello', 'world'])
Пример #5
0
    def test_get_nodes_by_value_and_property_int(self):
        new_properties = {'test': 3}
        core.set_node_properties(self.neo4jdb, handle_id='1', new_properties=new_properties)
        result = core.get_nodes_by_value(self.neo4jdb, value=3, prop='test')

        all_results = [r for r in result]
        self.assertEqual(len(all_results), 1)
        node = all_results[0]
        self.assertEqual(node.get('test'), 3)
Пример #6
0
 def test_search_nodes_by_value_and_property(self):
     new_properties = {'test': 'hello world'}
     core.set_node_properties(self.neo4jdb, handle_id='1', new_properties=new_properties)
     result = core.search_nodes_by_value(self.neo4jdb, value='world', prop='test')
     self.assertIsNotNone(result)
     for node in result:
         self.assertEqual(node.get('test'), 'hello world')
         return
     self.assertTrue(False, 'Nothing found')
Пример #7
0
    def test_search_nodes_by_value(self):
        new_properties = {'test': 'hello world'}
        core.set_node_properties(self.neo4jdb, handle_id='1', new_properties=new_properties)

        result = core.search_nodes_by_value(self.neo4jdb, value='world')

        all_results = [r for r in result]
        self.assertEqual(len(all_results), 1)
        node = all_results[0]
        self.assertEqual(node.get('test'), 'hello world')
Пример #8
0
 def test_get_nodes_by_value_and_property_int(self):
     new_properties = {'test': 3}
     core.set_node_properties(self.neo4jdb,
                              handle_id='1',
                              new_properties=new_properties)
     result = core.get_nodes_by_value(self.neo4jdb, value=3, prop='test')
     for node in result:
         self.assertEqual(node.get('test'), 3)
         return
     self.assertTrue(False, 'Nothing found')
Пример #9
0
 def test_search_nodes_by_value_and_property_in_list(self):
     new_properties = {'test': ['hello', 'world']}
     core.set_node_properties(self.neo4jdb,
                              handle_id='1',
                              new_properties=new_properties)
     result = core.search_nodes_by_value(self.neo4jdb,
                                         value='hel',
                                         prop='test')
     for node in result:
         self.assertEqual(node.get('test'), ['hello', 'world'])
         return
     self.assertTrue(False, 'Nothing found')
Пример #10
0
    def test_search_nodes_by_value(self):
        new_properties = {'test': 'hello world'}
        core.set_node_properties(self.neo4jdb,
                                 handle_id='1',
                                 new_properties=new_properties)

        result = core.search_nodes_by_value(self.neo4jdb, value='world')
        self.assertIsNotNone(result)
        for node in result:
            self.assertEqual(node.get('test'), 'hello world')
            return
        self.assertTrue(False, 'Nothing found')
Пример #11
0
 def test_set_node_properties(self):
     new_properties = {'test': 'hello world'}
     core.set_node_properties(self.neo4jdb, handle_id='1', new_properties=new_properties)
     node = core.get_node(self.neo4jdb, handle_id='1')
     new_properties.update({'handle_id': '1'})
     self.assertEqual(node, new_properties)