summaryrefslogtreecommitdiff
path: root/test/test_graph/test_graph_operator.py
blob: 87502c54b1a4e52f9289acc7aaa8ec00f20ff032 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from rdflib import Graph


class MyGraph(Graph):
    def my_method(self):
        pass


def test_subclass_add_operator():
    g = MyGraph()

    g = g + g
    assert "my_method" in dir(g)


def test_subclass_sub_operator():
    g = MyGraph()

    g = g - g
    assert "my_method" in dir(g)


def test_subclass_mul_operator():
    g = MyGraph()

    g = g * g
    assert "my_method" in dir(g)