Skip to content
Open
Changes from all commits
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
19 changes: 8 additions & 11 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,32 +197,26 @@ def feature_disable_only(feature):
continue
self.mod.feature_enable(f.name())

leaf_simple = next(self.ctx.find_path("/yolo-system:conf/yolo-system:speed"))

self.mod.feature_disable_all()
leaf_not = next(self.ctx.find_path("/yolo-system:conf/yolo-system:offline"))
self.mod.feature_enable_all()

leaf_and = next(self.ctx.find_path("/yolo-system:conf/yolo-system:full"))
leaf_or = next(
self.ctx.find_path("/yolo-system:conf/yolo-system:isolation-level")
)

# if-feature is just a feature
leaf_simple = next(self.ctx.find_path("/yolo-system:conf/yolo-system:speed"))
tree = next(leaf_simple.if_features()).tree()
self.mod.feature_enable_all()
self.assertEqual(tree.state(), True)
self.mod.feature_disable_all()
self.assertEqual(tree.state(), False)

# if-feature is "NOT networking"
self.mod.feature_disable_all()
leaf_not = next(self.ctx.find_path("/yolo-system:conf/yolo-system:offline"))
tree = next(leaf_not.if_features()).tree()
self.mod.feature_enable_all()
self.assertEqual(tree.state(), False)
self.mod.feature_disable_all()
self.assertEqual(tree.state(), True)

# if-feature is "turbo-boost AND networking"
self.mod.feature_enable_all()
leaf_and = next(self.ctx.find_path("/yolo-system:conf/yolo-system:full"))
tree = next(leaf_and.if_features()).tree()
self.mod.feature_enable_all()
self.assertEqual(tree.state(), True)
Expand All @@ -234,6 +228,9 @@ def feature_disable_only(feature):
self.assertEqual(tree.state(), False)

# if-feature is "turbo-boost OR networking"
leaf_or = next(
self.ctx.find_path("/yolo-system:conf/yolo-system:isolation-level")
)
tree = next(leaf_or.if_features()).tree()
self.mod.feature_enable_all()
self.assertEqual(tree.state(), True)
Expand Down