Example #1
0
    def setUp(self):
        """Start a new Connector for each test."""
        try:
            os.unlink("oplog.timestamp")
        except OSError:
            pass
        open("oplog.timestamp", "w").close()
        docman = DocManager('http://localhost:7474/db/data',
                            auto_commit_interval=0)
        self.connector = Connector(mongo_address=self.repl_set.uri,
                                   ns_set=['test.test'],
                                   doc_managers=(docman, ),
                                   gridfs_set=['test.test'])

        self.conn.test.test.drop()
        self.conn.test.test.files.drop()
        self.conn.test.test.chunks.drop()
        self.connector.start()
        self.neo4j_conn.delete_all()
        assert_soon(lambda: len(self.connector.shard_set) > 0)
        assert_soon(lambda: self._count() == 0)
        time.sleep(5)
 def tearDown(self):
   self.docman.graph.delete_all()
   self.graph.delete_all()
   self.docman = DocManager('http://localhost:7474/db/data', auto_commit_interval=0)
   self.graph = self.docman.graph
 def setUpClass(self):
   self.docman = DocManager('http://localhost:7474/db/data', auto_commit_interval=0)
   self.graph = self.docman.graph
class Neo4jTestCase(unittest.TestCase):
  @classmethod
  def setUpClass(self):
    self.docman = DocManager('http://*****:*****@unittest.skip("Not implmented yet")
  def test_bulk_upsert(self):
    self.docman.update(doc_id, 'test.talks', 1)
    self.assertEqual(self.graph.size, 0)
    self.tearDown

  def test_remove(self):
    docc = simple_doc
    id = docc['_id']
    self.docman.upsert(docc, 'test.samples', 1)
    self.docman.remove(id, 'test.samples', 1)
    self.assertEqual(self.graph.size, 0)
    self.tearDown

  @unittest.skip("Not implmented yet")
  def test_search(self):
    return

  @unittest.skip("Not implmented yet")
  def test_commands(self):
    return
Example #5
0
 def setUpClass(cls):
     cls.neo4j_conn = Graph('http://localhost:7474/db/data')
     cls.docman = DocManager('http://localhost:7474/db/data',
                             auto_commit_interval=0)
Example #6
0
 def tearDown(self):
     self.docman.graph.delete_all()
     self.graph.delete_all()
     self.docman = DocManager('http://localhost:7474/db/data',
                              auto_commit_interval=0)
     self.graph = self.docman.graph
Example #7
0
 def setUpClass(self):
     self.docman = DocManager('http://localhost:7474/db/data',
                              auto_commit_interval=0)
     self.graph = self.docman.graph
Example #8
0
class Neo4jTestCase(unittest.TestCase):
    @classmethod
    def setUpClass(self):
        self.docman = DocManager('http://*****:*****@unittest.skip("Not implmented yet")
    def test_get_last_doc(self):
        """Test the get_last_doc method.
    Make sure we can retrieve the document most recently modified from ES.
    """

    @unittest.skip("Not implmented yet")
    def test_commands(self):
        return