File: test_graph_operator.py

package info (click to toggle)
rdflib 6.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 38,248 kB
  • sloc: python: 39,216; sh: 153; makefile: 110
file content (27 lines) | stat: -rw-r--r-- 393 bytes parent folder | download | duplicates (2)
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)