replace everywhere: 'is [not] None' -> '(==|!=) None'

This commit is contained in:
Joeri Exelmans 2024-09-04 09:50:30 +02:00
parent 3ae35a87d0
commit ec1a9dbfca
28 changed files with 690 additions and 668 deletions

View file

@ -4,13 +4,13 @@ import pytest
@pytest.mark.usefixtures("state")
def test_read_reverse_dict_no_exists(state):
l = state.read_reverse_dict(-1, "abc")
assert l is None
assert l == None
@pytest.mark.usefixtures("state")
def test_read_reverse_dict_not_found_node(state):
a = state.create_node()
assert a is not None
assert a != None
# Passing data is not enforced, as the data will be interpreted if necessary
l = state.read_reverse_dict(a, "abc")
@ -20,7 +20,7 @@ def test_read_reverse_dict_not_found_node(state):
@pytest.mark.usefixtures("state")
def test_read_reverse_dict_not_found_nodevalue(state):
a = state.create_nodevalue(1)
assert a is not None
assert a != None
# Passing data is not enforced, as the data will be interpreted if necessary
l = state.read_reverse_dict(a, "abc")
@ -32,9 +32,9 @@ def test_read_reverse_dict_not_found_edge(state):
a = state.create_node()
b = state.create_node()
c = state.create_edge(a, b)
assert a is not None
assert b is not None
assert c is not None
assert a != None
assert b != None
assert c != None
# Passing data is not enforced, as the data will be interpreted if necessary
l = state.read_reverse_dict(c, "abc")
@ -44,7 +44,7 @@ def test_read_reverse_dict_not_found_edge(state):
@pytest.mark.usefixtures("state")
def test_read_reverse_dict_no_primitive(state):
a = state.create_node()
assert a is not None
assert a != None
# Passing data is not enforced, as the data will be interpreted if necessary
l = state.read_reverse_dict(a, a)
@ -58,11 +58,11 @@ def test_read_reverse_dict_node_simple(state):
c = state.create_nodevalue("f")
d = state.create_edge(a, b)
e = state.create_edge(d, c)
assert a is not None
assert b is not None
assert c is not None
assert d is not None
assert e is not None
assert a != None
assert b != None
assert c != None
assert d != None
assert e != None
l = state.read_reverse_dict(b, "f")
assert set(l) == set([a])
@ -75,11 +75,11 @@ def test_read_reverse_dict_no_match(state):
c = state.create_nodevalue("g")
d = state.create_edge(a, b)
e = state.create_edge(d, c)
assert a is not None
assert b is not None
assert c is not None
assert d is not None
assert e is not None
assert a != None
assert b != None
assert c != None
assert d != None
assert e != None
l = state.read_reverse_dict(b, "f")
assert l == []
@ -92,20 +92,20 @@ def test_read_reverse_dict_node_multi(state):
c = state.create_nodevalue("f")
d = state.create_edge(a, b)
e = state.create_edge(d, c)
assert a is not None
assert b is not None
assert c is not None
assert d is not None
assert e is not None
assert a != None
assert b != None
assert c != None
assert d != None
assert e != None
g = state.create_node()
h = state.create_nodevalue("k")
i = state.create_edge(a, g)
j = state.create_edge(i, h)
assert g is not None
assert h is not None
assert i is not None
assert j is not None
assert g != None
assert h != None
assert i != None
assert j != None
l = state.read_reverse_dict(b, "f")
assert set(l) == set([a])
@ -124,20 +124,20 @@ def test_read_reverse_dict_node_multi_ambiguous(state):
c = state.create_nodevalue("f")
d = state.create_edge(b, a)
e = state.create_edge(d, c)
assert a is not None
assert b is not None
assert c is not None
assert d is not None
assert e is not None
assert a != None
assert b != None
assert c != None
assert d != None
assert e != None
g = state.create_node()
h = state.create_nodevalue("f")
i = state.create_edge(g, a)
j = state.create_edge(i, h)
assert g is not None
assert h is not None
assert i is not None
assert j is not None
assert g != None
assert h != None
assert i != None
assert j != None
l = state.read_reverse_dict(a, "f")
assert set(l) == set([b, g])
@ -150,16 +150,16 @@ def test_read_reverse_dict_node_uncertain(state):
c = state.create_nodevalue("f")
d = state.create_edge(a, b)
e = state.create_edge(d, c)
assert a is not None
assert b is not None
assert c is not None
assert d is not None
assert e is not None
assert a != None
assert b != None
assert c != None
assert d != None
assert e != None
h = state.create_nodevalue("g")
i = state.create_edge(d, h)
assert h is not None
assert i is not None
assert h != None
assert i != None
l = state.read_reverse_dict(b, "f")
assert set(l) == set([a])