Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions tests/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,30 @@ def get_driver_features(backend):
response = backend.sendAndReceive(protocol.GetFeatures())
if not isinstance(response, protocol.FeatureList):
raise Exception("Response is not instance of FeatureList")
features = set(response.features)
raw_features = set(response.features)
features = set()
for raw in raw_features:
try:
features.add(protocol.Feature(raw))
except ValueError: # ignore features we don't know
warnings.warn('Unknown feature "%s"' % raw)
# TODO: remove this once all drivers manage the TLS feature flags
# themselves.
if get_driver_name() in ["java", "go"]:
features.add(protocol.Feature.TLS_1_1.value)
features.add(protocol.Feature.TLS_1_1)
if get_driver_name() in ["java", "go", "dotnet"]:
features.add(protocol.Feature.TLS_1_2.value)
features.add(protocol.Feature.TLS_1_2)
if get_driver_name() in ["go"]:
features.add(protocol.Feature.TLS_1_3.value)
features.add(protocol.Feature.TLS_1_3)
if get_driver_name() in ["javascript", "go", "dotnet"]:
features.add(
f.value for f in (
protocol.Feature.BOLT_3_0,
protocol.Feature.BOLT_4_0,
protocol.Feature.BOLT_4_1,
protocol.Feature.BOLT_4_2,
protocol.Feature.BOLT_4_3,
protocol.Feature.BOLT_4_4,
)
)
features.add((
protocol.Feature.BOLT_3_0,
protocol.Feature.BOLT_4_0,
protocol.Feature.BOLT_4_1,
protocol.Feature.BOLT_4_2,
protocol.Feature.BOLT_4_3,
protocol.Feature.BOLT_4_4,
))
print("features", features)
return features
except (OSError, protocol.BaseError) as e:
Expand Down Expand Up @@ -215,7 +219,7 @@ def setUp(self):
response))

def driver_missing_features(self, *features):
needed = set(map(lambda f: f.value, features))
needed = set(features)
supported = self._driver_features
return needed - supported

Expand Down