初始化

This commit is contained in:
2025-11-15 07:42:57 +08:00
commit 19cc8a992e
18 changed files with 1004 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
"""Unit test package for SmartSaveImage."""
+6
View File
@@ -0,0 +1,6 @@
import os
import sys
# Add the project root directory to Python path
# This allows the tests to import the project
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
+4
View File
@@ -0,0 +1,4 @@
[pytest]
testpaths = . # Run tests in the current directory
python_files = test_*.py # Run tests in files that start with "test_"
norecursedirs = .. # Don't run tests in the parent directory
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env python
"""Tests for `SmartSaveImage` package."""
import pytest
from src.SmartSaveImage.nodes import Example
@pytest.fixture
def example_node():
"""Fixture to create an Example node instance."""
return Example()
def test_example_node_initialization(example_node):
"""Test that the node can be instantiated."""
assert isinstance(example_node, Example)
def test_return_types():
"""Test the node's metadata."""
assert Example.RETURN_TYPES == ("IMAGE",)
assert Example.FUNCTION == "test"
assert Example.CATEGORY == "Example"