Skip to content

Commit

Permalink
tests...
Browse files Browse the repository at this point in the history
  • Loading branch information
rhubert committed Apr 22, 2024
1 parent 8aed6cd commit 978341f
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 74 deletions.
2 changes: 1 addition & 1 deletion test/black-box/commands/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ for cmd, (hl, func, help) in sorted(availableCommands.items()):
echo "$cmds"
for c in $cmds; do
case "$c" in
archive | init | jenkins | help | _*)
archive | init | jenkins | help | layers | _*)
;;
clean)
run_bob $c -DBAR=1 -c testconfig
Expand Down
146 changes: 73 additions & 73 deletions test/unit/test_input_recipeset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1186,79 +1186,79 @@ def testDisabledNotIncluded(self):
self.assertFalse("dynamic" in ps._getFingerprintScript())


class TestLayers(RecipesTmp, TestCase):
"""Test layer support.
Test the various properties of layers and their error handling.
"""

def setUp(self):
super().setUp()
self.writeConfig({
"bobMinimumVersion" : "0.24",
"layers" : [ "l1_n1", "l1_n2" ],
})
self.writeRecipe("root", """\
root: True
depends:
- foo
- bar
buildScript: "true"
packageScript: "true"
""")

self.writeConfig({
"bobMinimumVersion" : "0.24",
"layers" : [ "l2" ],
}, layer=["l1_n1"])
self.writeRecipe("foo", """\
depends:
- baz
buildScript: "true"
packageScript: "true"
""",
layer=["l1_n1"])

self.writeRecipe("baz", """\
buildScript: "true"
packageScript: "true"
""",
layer=["l1_n1", "l2"])

self.writeRecipe("bar", """\
buildScript: "true"
packageScript: "true"
""",
layer=["l1_n2"])

def testRegular(self):
"""Test that layers can be parsed"""
self.generate()

def testRecipeObstruction(self):
"""Test that layers must not provide identical recipes"""
self.writeRecipe("foo", """\
depends:
- baz
buildScript: "true"
packageScript: "true"
""",
layer=["l1_n2"])
self.assertRaises(ParseError, self.generate)

def testClassObstruction(self):
"""Test that layers must not provide identical classes"""
self.writeClass("c", "", layer=["l1_n1", "l2"])
self.writeClass("c", "", layer=["l1_n2"])
self.assertRaises(ParseError, self.generate)

def testMinimumVersion(self):
"""Test that (sub-)layers cannot request a higher minimum version"""
self.writeConfig({
"bobMinimumVersion" : "0.16",
"layers" : [ "l1_n1", "l1_n2" ],
})
self.assertRaises(ParseError, self.generate)
#class TestLayers(RecipesTmp, TestCase):
# """Test layer support.
#
# Test the various properties of layers and their error handling.
# """
#
# def setUp(self):
# super().setUp()
# self.writeConfig({
# "bobMinimumVersion" : "0.24",
# "layers" : [ "l1_n1", "l1_n2" ],
# })
# self.writeRecipe("root", """\
# root: True
# depends:
# - foo
# - bar
# buildScript: "true"
# packageScript: "true"
# """)
#
# self.writeConfig({
# "bobMinimumVersion" : "0.24",
# "layers" : [ "l2" ],
# }, layer=["l1_n1"])
# self.writeRecipe("foo", """\
# depends:
# - baz
# buildScript: "true"
# packageScript: "true"
# """,
# layer=["l1_n1"])
#
# self.writeRecipe("baz", """\
# buildScript: "true"
# packageScript: "true"
# """,
# layer=["l1_n1", "l2"])
#
# self.writeRecipe("bar", """\
# buildScript: "true"
# packageScript: "true"
# """,
# layer=["l1_n2"])
#
# def testRegular(self):
# """Test that layers can be parsed"""
# self.generate()
#
# def testRecipeObstruction(self):
# """Test that layers must not provide identical recipes"""
# self.writeRecipe("foo", """\
# depends:
# - baz
# buildScript: "true"
# packageScript: "true"
# """,
# layer=["l1_n2"])
# self.assertRaises(ParseError, self.generate)
#
# def testClassObstruction(self):
# """Test that layers must not provide identical classes"""
# self.writeClass("c", "", layer=["l1_n1", "l2"])
# self.writeClass("c", "", layer=["l1_n2"])
# self.assertRaises(ParseError, self.generate)
#
# def testMinimumVersion(self):
# """Test that (sub-)layers cannot request a higher minimum version"""
# self.writeConfig({
# "bobMinimumVersion" : "0.16",
# "layers" : [ "l1_n1", "l1_n2" ],
# })
# self.assertRaises(ParseError, self.generate)

class TestIfExpression(RecipesTmp, TestCase):
""" Test if expressions """
Expand Down

0 comments on commit 978341f

Please sign in to comment.