Skip to content

Commit 004eb22

Browse files
committed
test(unit): replace magic number with named constant in TestEdgeTypeInfo
Introduce PROPERTY_TYPE_TIMESTAMP = 6 as a class-level constant to replace the inline magic number that SonarCloud flagged as commented-out code.
1 parent f69e7b7 commit 004eb22

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/unit/test_schema_crud.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,16 @@ def test_version_zero(self):
127127

128128

129129
class TestEdgeTypeInfo:
130+
PROPERTY_TYPE_TIMESTAMP = 6
131+
130132
def test_basic_fields(self):
131133
et = EdgeTypeInfo(_FakeEdgeType("KNOWS", version=1))
132134
assert et.name == "KNOWS"
133135
assert et.version == 1
134136
assert et.properties == []
135137

136138
def test_properties_are_wrapped(self):
137-
props = [_FakePropDef("since", 6)] # 6 = TIMESTAMP
139+
props = [_FakePropDef("since", self.PROPERTY_TYPE_TIMESTAMP)]
138140
et = EdgeTypeInfo(_FakeEdgeType("FOLLOWS", properties=props))
139141
assert len(et.properties) == 1
140142
assert et.properties[0].name == "since"

0 commit comments

Comments
 (0)