Exemple #1
0
def test_relationship_exists_will_raise_non_404_errors(graph):
    with patch.object(_Resource, "get") as mocked:
        error = GraphError("bad stuff happened")
        error.response = DodgyClientError()
        mocked.side_effect = error
        a, b, ab = graph.create({}, {}, (0, "KNOWS", 1))
        try:
            _ = ab.exists
        except GraphError:
            assert True
        else:
            assert False
Exemple #2
0
def test_node_exists_will_raise_non_404_errors():
    with patch.object(_Resource, "get") as mocked:
        error = GraphError("bad stuff happened")
        error.response = DodgyClientError()
        mocked.side_effect = error
        alice = Node(name="Alice Smith")
        alice.bind("http://localhost:7474/db/data/node/1")
        try:
            _ = alice.exists
        except GraphError:
            assert True
        else:
            assert False
Exemple #3
0
def test_node_exists_will_raise_non_404_errors():
    with patch.object(_Resource, "get") as mocked:
        error = GraphError("bad stuff happened")
        error.response = DodgyClientError()
        mocked.side_effect = error
        alice = Node(name="Alice Smith")
        alice.bind("http://localhost:7474/db/data/node/1")
        try:
            _ = alice.exists
        except GraphError:
            assert True
        else:
            assert False