-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_seed_tracking.py
More file actions
57 lines (44 loc) · 1.95 KB
/
test_seed_tracking.py
File metadata and controls
57 lines (44 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python3
"""
Test script to verify seed tracking functionality
"""
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "nodes"))
from random_value_tracker import SeedHistory # noqa: E402
def test_seed_tracking():
"""Test the basic seed tracking functionality"""
print("Testing SeedHistory node...")
# Test node creation
seed_node = SeedHistory()
print("✅ SeedHistory node created successfully")
# Test basic functionality
result = seed_node.output_seed(12345)
assert result == (12345,), f"Expected (12345,), got {result}"
print("✅ Basic seed output working")
# Test with different seed values
test_seeds = [0, 1, 42, 123456789, 0xFFFFFFFFFFFFFFFF]
for seed in test_seeds:
result = seed_node.output_seed(seed)
assert result == (seed,), f"Expected ({seed},), got {result}"
print("✅ Multiple seed values working")
# Test node structure
assert hasattr(seed_node, "INPUT_TYPES"), "Missing INPUT_TYPES method"
assert hasattr(seed_node, "RETURN_TYPES"), "Missing RETURN_TYPES"
assert hasattr(seed_node, "RETURN_NAMES"), "Missing RETURN_NAMES"
assert hasattr(seed_node, "FUNCTION"), "Missing FUNCTION"
assert hasattr(seed_node, "CATEGORY"), "Missing CATEGORY"
print("✅ Node structure is correct")
# Test input types
input_types = SeedHistory.INPUT_TYPES()
assert "required" in input_types, "Missing required inputs"
assert "seed" in input_types["required"], "Missing seed input"
seed_config = input_types["required"]["seed"]
assert seed_config[0] == "INT", "Seed should be INT type"
assert "default" in seed_config[1], "Missing default value"
assert "min" in seed_config[1], "Missing min value"
assert "max" in seed_config[1], "Missing max value"
print("✅ Input types configuration is correct")
print("\n🎉 All seed tracking tests passed!")
if __name__ == "__main__":
test_seed_tracking()