def testAddUniqueNode(self):
        self.assertEqual(len(list(Index.find(self.g, {"name": "Test Index 6"}))), 0)

        Index.new(self.g, {"name": "Test Index 6"}, unique=True)
        self.assertEqual(len(list(Index.find(self.g, {"name": "Test Index 6"}))), 1)

        Index.new(self.g, {"name": "Test Index 6"}, unique=True)
        self.assertEqual(len(list(Index.find(self.g, {"name": "Test Index 6"}))), 1)
Exemple #2
0
    def testAddUniqueNode(self):
        self.assertEqual(
            len(list(Index.find(self.g, {"name": "Test Index 6"}))), 0)

        Index.new(self.g, {"name": "Test Index 6"}, unique=True)
        self.assertEqual(
            len(list(Index.find(self.g, {"name": "Test Index 6"}))), 1)

        Index.new(self.g, {"name": "Test Index 6"}, unique=True)
        self.assertEqual(
            len(list(Index.find(self.g, {"name": "Test Index 6"}))), 1)
    def testAddOrNewCompanyToIndex(self):
        i = Index.new(self.g, {"name": "Test Index 3"})

        self.assertEqual(len(list(i.get_companies())), 0)

        i.add_companies([{'name': "CBS"}])
        i.add_companies([{'name': "CBS"}], unique=True)

        self.assertEqual(len(list(i.get_companies())), 1)
Exemple #4
0
    def testAddOrNewCompanyToIndex(self):
        i = Index.new(self.g, {"name": "Test Index 3"})

        self.assertEqual(len(list(i.get_companies())), 0)

        i.add_companies([{'name': "CBS"}])
        i.add_companies([{'name': "CBS"}], unique=True)

        self.assertEqual(len(list(i.get_companies())), 1)
 def testAddedNodesWrapActualNodes(self):
     i = Index.new(self.g, {"name": "Test Index"})
     c = i.add_companies([{"name": "Fluffer"}])[0]
     self.assertIsInstance(c.n, Node)
 def testAddCompanyToIndex(self):
     i = Index.new(self.g, {"name": "Test Index 6"})
     self.assertEqual(len(list(i.get_companies())), 0)
     i.add_companies([{'name': "CBS"}, {'name': 'ABC'}])
     self.assertEqual(len(list(i.get_companies())), 2)
 def testCreateAndFindIndex(self):
     index_name = "Test Index 4"
     i = Index.new(self.g, {"name": index_name}).push()
     ix = Index.find_one(self.g, dict(name=index_name))
     self.assertEqual(i, ix)
 def testCreateIndexNode(self):
     i = Index.new(self.g, {"name": "Test Index 2"})
     self.assertIsInstance(i, Index)
     self.assertEqual(i.n.properties['name'], "Test Index 2")
Exemple #9
0
 def testAddedNodesWrapActualNodes(self):
     i = Index.new(self.g, {"name": "Test Index"})
     c = i.add_companies([{"name": "Fluffer"}])[0]
     self.assertIsInstance(c.n, Node)
Exemple #10
0
 def testAddCompanyToIndex(self):
     i = Index.new(self.g, {"name": "Test Index 6"})
     self.assertEqual(len(list(i.get_companies())), 0)
     i.add_companies([{'name': "CBS"}, {'name': 'ABC'}])
     self.assertEqual(len(list(i.get_companies())), 2)
Exemple #11
0
 def testCreateAndFindIndex(self):
     index_name = "Test Index 4"
     i = Index.new(self.g, {"name": index_name}).push()
     ix = Index.find_one(self.g, dict(name=index_name))
     self.assertEqual(i, ix)
Exemple #12
0
 def testCreateIndexNode(self):
     i = Index.new(self.g, {"name": "Test Index 2"})
     self.assertIsInstance(i, Index)
     self.assertEqual(i.n.properties['name'], "Test Index 2")