Update pattern tests for new preset-based API
- Replace add() calls with edit() for preset creation - Update tests to work with merged patterns.py - Ensure all tests use new Preset object structure
This commit is contained in:
@@ -24,7 +24,7 @@ def main():
|
||||
|
||||
# Test 1: Basic circle (n1=50, n2=100, n3=200, n4=0)
|
||||
print("Test 1: Basic circle (n1=50, n2=100, n3=200, n4=0)")
|
||||
p.add("circle1", {
|
||||
p.edit("circle1", {
|
||||
"pattern": "circle",
|
||||
"brightness": 255,
|
||||
"n1": 50, # Head moves 50 LEDs/second
|
||||
@@ -38,7 +38,7 @@ def main():
|
||||
|
||||
# Test 2: Slow growth, fast shrink (n1=20, n2=50, n3=100, n4=0)
|
||||
print("Test 2: Slow growth, fast shrink (n1=20, n2=50, n3=100, n4=0)")
|
||||
p.add("circle2", {
|
||||
p.edit("circle2", {
|
||||
"pattern": "circle",
|
||||
"n1": 20,
|
||||
"n2": 50,
|
||||
@@ -51,7 +51,7 @@ def main():
|
||||
|
||||
# Test 3: Fast growth, slow shrink (n1=100, n2=30, n3=20, n4=0)
|
||||
print("Test 3: Fast growth, slow shrink (n1=100, n2=30, n3=20, n4=0)")
|
||||
p.add("circle3", {
|
||||
p.edit("circle3", {
|
||||
"pattern": "circle",
|
||||
"n1": 100,
|
||||
"n2": 30,
|
||||
@@ -64,7 +64,7 @@ def main():
|
||||
|
||||
# Test 4: With minimum length (n1=50, n2=40, n3=100, n4=10)
|
||||
print("Test 4: With minimum length (n1=50, n2=40, n3=100, n4=10)")
|
||||
p.add("circle4", {
|
||||
p.edit("circle4", {
|
||||
"pattern": "circle",
|
||||
"n1": 50,
|
||||
"n2": 40,
|
||||
@@ -77,7 +77,7 @@ def main():
|
||||
|
||||
# Test 5: Very fast (n1=200, n2=20, n3=200, n4=0)
|
||||
print("Test 5: Very fast (n1=200, n2=20, n3=200, n4=0)")
|
||||
p.add("circle5", {
|
||||
p.edit("circle5", {
|
||||
"pattern": "circle",
|
||||
"n1": 200,
|
||||
"n2": 20,
|
||||
@@ -90,7 +90,7 @@ def main():
|
||||
|
||||
# Test 6: Very slow (n1=10, n2=25, n3=10, n4=0)
|
||||
print("Test 6: Very slow (n1=10, n2=25, n3=10, n4=0)")
|
||||
p.add("circle6", {
|
||||
p.edit("circle6", {
|
||||
"pattern": "circle",
|
||||
"n1": 10,
|
||||
"n2": 25,
|
||||
@@ -103,7 +103,7 @@ def main():
|
||||
|
||||
# Cleanup
|
||||
print("Test complete, turning off")
|
||||
p.add("cleanup_off", {"pattern": "off"})
|
||||
p.edit("cleanup_off", {"pattern": "off"})
|
||||
p.select("cleanup_off")
|
||||
run_for(p, wdt, 100)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user