Files
TashaSkyUp-EternalKernelPyt…/tests/test_git.py
T
Tasha Upchurch df699a302e aider: Fixed import error in test_git.py.
# Context:
USER: I ran this command:

 python E:/git/ComfyUI/custom_nodes/EternalKernelLiteGraphNodes/tests/test_git.py

And got this output:

Traceback (most recent call last):
  File "E:\git\ComfyUI\custom_nodes\EternalKernelLiteGraphNodes\tests\test_git.py", line 6, in <module>
    from custom_nodes.git import CreateRepoNode
ModuleNotFoundError: No module named 'custom_nodes.git'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\git\ComfyUI\custom_nodes\EternalKernelLiteGraphNodes\tests\test_git.py", line 8, in <module>
    from custom_nodes.git import CreateRepoNode
ModuleNotFoundError: No module named 'custom_nodes.git'
2023-07-07 03:00:24 -04:00

18 lines
559 B
Python

import unittest
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
try:
from custom_nodes.EternalKernelLiteGraphNodes.git import CreateRepoNode
except ImportError:
from custom_nodes.git import CreateRepoNode
class TestCreateRepoNode(unittest.TestCase):
def test_create_repo(self):
node = CreateRepoNode()
node.create_repo(subdirectory="my_repo")
# Add assertions or additional test logic here
if __name__ == "__main__":
unittest.main()