test_query_index failure #34

Closed
doismellburning opened this Issue Sep 3, 2011 · 3 comments

Comments

Projects
None yet
2 participants
@doismellburning
Contributor

doismellburning commented Sep 3, 2011

I've just cloned HEAD of master (819531d) and run the tests; I get the below failure

======================================================================
FAIL: test_query_index (__main__.Neo4jPythonClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "neo4jrestclient/tests.py", line 321, in test_query_index
    self.assertTrue(n1 in results and n2 in results)
AssertionError: False is not True

----------------------------------------------------------------------

and in fact, all of the below fails:


    def test_query_index(self):
        n1 = self.gdb.nodes.create(name="John Doe", place="Texas")
        n2 = self.gdb.nodes.create(name="Michael Donald", place="Tijuana")
        index = self.gdb.nodes.indexes.create(name="do", type="fulltext")
        index["surnames"]["doe"] = n1
        index["surnames"]["donald"] = n2
        index['place']['Texas'] = n1
        index['place']['Tijuana'] = n2
        results = index.query("surnames", "do*")
        self.assertTrue(n1 in results and n2 in results)
        results = index.query("surnames:do*")
        self.assertTrue(n1 in results and n2 in results)

        #### All subsequent assertions fail

        results = index.query('surnames', Q('do*'))
        self.assertTrue(n1 in results and n2 in results)
        results = index.query(Q('surnames', 'do*'))
        self.assertTrue(n1 in results and n2 in results)
        results = index.query(Q('surnames', 'do*') & Q('place', 'Tijuana'))
        self.assertTrue(n1 not in results and n2 in results)
        results = index.query(-Q('surnames', 'donald') | +Q('place', 'Texas'))
        self.assertTrue(n2 not in results and n1 in results)

I'm assuming it has something to do with the use of Q (imported as below):

from lucenequerybuilder import Q

I note that requirements.text specifies lucene-querybuilder==0.1.2 where the .egg file for what I have installed specifies >=0.1.2 (I have 0.1.4 installed)

I suspect that lucene-querybuilder is where the issue lies, but file this request for reference / in case someone else can help or find the answer faster than me, or tell me I'm doing something wrong

Thanks

@versae

This comment has been minimized.

Show comment
Hide comment
@versae

versae Sep 3, 2011

Owner

Thank you for reporting. As you say, the requirements,txt file specifies the lucene-querybuilder version 1.2, because I have not tested yet the a new version. But thank you again for discovering me this, so I'm going to open an issue in the lucene-querybuilder project right now.

Regards!

Owner

versae commented Sep 3, 2011

Thank you for reporting. As you say, the requirements,txt file specifies the lucene-querybuilder version 1.2, because I have not tested yet the a new version. But thank you again for discovering me this, so I'm going to open an issue in the lucene-querybuilder project right now.

Regards!

@versae versae closed this Sep 3, 2011

@doismellburning

This comment has been minimized.

Show comment
Hide comment
@doismellburning

doismellburning Sep 3, 2011

Contributor

Right, well, setup.py has >=0.1.2 so I guess that's not desired (https://github.com/versae/neo4j-rest-client/blob/master/setup.py)

Sorry, I'd fix this myself and send a pull request (admittedly the change is trivial) but I'm having problems setting up an env with 0.1.2 on this machine so can't actually verify anything.

Cheers!

Contributor

doismellburning commented Sep 3, 2011

Right, well, setup.py has >=0.1.2 so I guess that's not desired (https://github.com/versae/neo4j-rest-client/blob/master/setup.py)

Sorry, I'd fix this myself and send a pull request (admittedly the change is trivial) but I'm having problems setting up an env with 0.1.2 on this machine so can't actually verify anything.

Cheers!

@versae versae reopened this Sep 3, 2011

@versae

This comment has been minimized.

Show comment
Hide comment
@versae

versae Sep 3, 2011

Owner

You are totally right.

Owner

versae commented Sep 3, 2011

You are totally right.

@ghost ghost assigned versae Sep 3, 2011

@versae versae closed this in 5e6eabe Sep 3, 2011

mhluongo added a commit to mhluongo/neo4j-rest-client that referenced this issue Sep 4, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment