feat: Implement depth surface strip cleanup and organize tool CLI
- Added a proposal for depth surface strip cleanup, detailing the rationale and changes to the depth plane and cutout nodes. - Created specifications for the new cleanup requirements, including scenarios for strip removal and boundary edge detection. - Developed tasks for implementing shared strip detection logic and integrating new interfaces for depth nodes. - Established a new CLI structure for organizing node groups and model commands, replacing old entry points with a more intuitive command structure. - Introduced a prototype for panorama surface generation, including requirements for distance reconstruction and geometry node surfaces. - Added comprehensive tests for depth strip cleanup functionality, ensuring correct behavior for various mesh topologies and edge cases.
This commit is contained in:
@@ -1,6 +1,26 @@
|
||||
from tests.support.paths import PROJECT_ROOT
|
||||
import tomllib
|
||||
import unittest
|
||||
import importlib
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.parametrize("module_name", ["tools.nodes.cli", "tools.models.cli"])
|
||||
@pytest.mark.parametrize("arguments,code", [([], None), (["--help"], 0), (["unknown"], 2), (["--bad-option"], 2)])
|
||||
def test_help_and_invalid_arguments_do_not_start_work(module_name, arguments, code, capsys):
|
||||
module = importlib.import_module(module_name)
|
||||
with patch("sys.argv", ["tool", *arguments]), patch.object(module.subprocess, "run") as run:
|
||||
if code is None:
|
||||
module.main()
|
||||
else:
|
||||
with pytest.raises(SystemExit) as error:
|
||||
module.main()
|
||||
assert error.value.code == code
|
||||
run.assert_not_called()
|
||||
captured = capsys.readouterr()
|
||||
assert "usage:" in captured.out + captured.err
|
||||
|
||||
|
||||
class ToolCommandsTests(unittest.TestCase):
|
||||
@@ -12,8 +32,8 @@ class ToolCommandsTests(unittest.TestCase):
|
||||
project["scripts"],
|
||||
{
|
||||
"pack": "tools.pack:main",
|
||||
"build_nodes": "tools.nodes.cli:main",
|
||||
"sync_models": "tools.models.cli:main",
|
||||
"node-group": "tools.nodes.cli:main",
|
||||
"model": "tools.models.cli:main",
|
||||
"docs": "tools.docs:main",
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user