Skip to content

Commit

Permalink
Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang committed Dec 28, 2024
1 parent 69bd49a commit 8211dbd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 15 deletions.
16 changes: 14 additions & 2 deletions {{cookiecutter.project_name}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## {{cookiecutter.project_short_description}}

## Getting Started
## Install

[Install](https://docs.comfy.org/get_started/manual_install) ComfyUI and git clone this repository in the `custom_nodes` directory of ComfyUI.
[Install](https://docs.comfy.org/get_started) ComfyUI first. Then look up this extension in [ComfyUI-Manager](https://github.com/ltdrdata/ComfyUI-Manager). If you are installing manually, clone this repository under `ComfyUI/custom_nodes`.


## Develop
Expand All @@ -19,6 +19,18 @@ pre-commit install

The `-e` flag above will result in a "live" install, in the sense that any changes you make to your node extension will automatically be picked up the next time you run ComfyUI.

## Using Github

Install Github Desktop or follow these [instructions] (https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) for ssh.

1. Create a Github repository that matches the directory name.
2. Push the files to Git
```
git add .
git commit -m "project scaffolding"
git push
```

## Publishing to Registry

If you wish to share this custom node with others in the community, you can publish it to the registry. We've already auto-populated some fields in `pyproject.toml` under `tool.comfy`, but please double-check if they are correct.
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_name}}/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
__email__ = "{{cookiecutter.email}}"
__version__ = "{{cookiecutter.version}}"

from .src.{{cookiecutter.project_slug}}.nodes import NODE_CLASS_MAPPINGS
from .src.{{cookiecutter.project_slug}}.nodes import NODE_DISPLAY_NAME_MAPPINGS
from src.{{cookiecutter.project_slug}}.nodes import NODE_CLASS_MAPPINGS
from src.{{cookiecutter.project_slug}}.nodes import NODE_DISPLAY_NAME_MAPPINGS

{% if cookiecutter.__include_web -%}
WEB_DIRECTORY = "./web"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
"""Tests for `{{ cookiecutter.project_slug }}` package."""

import pytest
from {{ cookiecutter.project_slug }} import {{ cookiecutter.project_slug }}
from src.{{ cookiecutter.project_slug }}.nodes import Example

@pytest.fixture
def response():
"""Sample pytest fixture.
def example_node():
"""Fixture to create an Example node instance."""
return Example()

See more at: http://doc.pytest.org/en/latest/fixture.html
"""
# import requests
# return requests.get('https://github.com/audreyr/cookiecutter-pypackage')
def test_example_node_initialization(example_node):
"""Test that the node can be instantiated."""
assert isinstance(example_node, Example)


def test_content(response):
"""Sample pytest test function with the pytest fixture as an argument."""
# from bs4 import BeautifulSoup
def test_return_types():
"""Test the node's metadata."""
assert Example.RETURN_TYPES == ("IMAGE",)
assert Example.FUNCTION == "test"
assert Example.CATEGORY == "Example"

0 comments on commit 8211dbd

Please sign in to comment.