Skip to content

Commit f4ef1d2

Browse files
authored
Merge pull request #2 from StableLlama/more_tests
Try to make unique node names
2 parents a584e8d + cf3d3cf commit f4ef1d2

File tree

4 files changed

+89
-96
lines changed

4 files changed

+89
-96
lines changed

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,3 @@ ComfyUI has different data types that serve different purposes:
155155
- Allow nodes to iterate through your items automatically
156156
- Connect to nodes that expect individual inputs
157157
- Perform batch processing operations
158-
159-
## Tests
160-
161-
This repo contains unit tests written in Pytest in the `tests/` directory. It is recommended to unit test your custom node.
162-
163-
- [build-pipeline.yml](.github/workflows/build-pipeline.yml) will run pytest and linter on any open PRs
164-
- [validate.yml](.github/workflows/validate.yml) will run [node-diff](https://github.com/Comfy-Org/node-diff) to check for breaking changes

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "basic_data_handling"
7-
version = "0.0.9"
7+
version = "0.0.10"
88
description = """NOTE: Still in development! Expect breaking changes!
99
Basic Python functions for manipulating data that every programmer is used to.
1010
Currently supported ComfyUI data types: BOOLEAN, FLOAT, INT, STRING and data lists.

src/basic_data_handling/string_nodes.py

Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def center(self, string, width, fillchar=" "):
7979
return (string.center(width, fillchar),)
8080

8181

82-
class DataStringConcat:
82+
class StringConcat:
8383
"""Combines two text strings together, joining them end-to-end."""
8484
@classmethod
8585
def INPUT_TYPES(cls):
@@ -1214,92 +1214,92 @@ def zfill(self, string, width):
12141214

12151215

12161216
NODE_CLASS_MAPPINGS = {
1217-
"StringCapitalize": StringCapitalize,
1218-
"StringCasefold": StringCasefold,
1219-
"StringCenter": StringCenter,
1220-
"DataStringConcat": DataStringConcat,
1221-
"StringCount": StringCount,
1222-
"StringDecode": StringDecode,
1223-
"StringEncode": StringEncode,
1224-
"StringExpandtabs": StringExpandtabs,
1225-
"StringEndswith": StringEndswith,
1226-
"StringFind": StringFind,
1227-
"StringFormatMap": StringFormatMap,
1228-
"StringIsAlnum": StringIsAlnum,
1229-
"StringIsAlpha": StringIsAlpha,
1230-
"StringIsAscii": StringIsAscii,
1231-
"StringIsDecimal": StringIsDecimal,
1232-
"StringIsDigit": StringIsDigit,
1233-
"StringIsIdentifier": StringIsIdentifier,
1234-
"StringIsLower": StringIsLower,
1235-
"StringIsNumeric": StringIsNumeric,
1236-
"StringIsPrintable": StringIsPrintable,
1237-
"StringIsSpace": StringIsSpace,
1238-
"StringIsTitle": StringIsTitle,
1239-
"StringIsUpper": StringIsUpper,
1240-
"StringJoin": StringJoin,
1241-
"StringLjust": StringLjust,
1242-
"StringLower": StringLower,
1243-
"StringLstrip": StringLstrip,
1244-
"StringRemoveprefix": StringRemoveprefix,
1245-
"StringRemovesuffix": StringRemovesuffix,
1246-
"StringReplace": StringReplace,
1247-
"StringRfind": StringRfind,
1248-
"StringRjust": StringRjust,
1249-
"StringRsplit": StringRsplit,
1250-
"StringRstrip": StringRstrip,
1251-
"StringSplit": StringSplit,
1252-
"StringSplitlines": StringSplitlines,
1253-
"StringStartswith": StringStartswith,
1254-
"StringStrip": StringStrip,
1255-
"StringSwapcase": StringSwapcase,
1256-
"StringTitle": StringTitle,
1257-
"StringUpper": StringUpper,
1258-
"StringZfill": StringZfill,
1217+
"Basic data handling: StringCapitalize": StringCapitalize,
1218+
"Basic data handling: StringCasefold": StringCasefold,
1219+
"Basic data handling: StringCenter": StringCenter,
1220+
"Basic data handling: StringConcat": StringConcat,
1221+
"Basic data handling: StringCount": StringCount,
1222+
"Basic data handling: StringDecode": StringDecode,
1223+
"Basic data handling: StringEncode": StringEncode,
1224+
"Basic data handling: StringExpandtabs": StringExpandtabs,
1225+
"Basic data handling: StringEndswith": StringEndswith,
1226+
"Basic data handling: StringFind": StringFind,
1227+
"Basic data handling: StringFormatMap": StringFormatMap,
1228+
"Basic data handling: StringIsAlnum": StringIsAlnum,
1229+
"Basic data handling: StringIsAlpha": StringIsAlpha,
1230+
"Basic data handling: StringIsAscii": StringIsAscii,
1231+
"Basic data handling: StringIsDecimal": StringIsDecimal,
1232+
"Basic data handling: StringIsDigit": StringIsDigit,
1233+
"Basic data handling: StringIsIdentifier": StringIsIdentifier,
1234+
"Basic data handling: StringIsLower": StringIsLower,
1235+
"Basic data handling: StringIsNumeric": StringIsNumeric,
1236+
"Basic data handling: StringIsPrintable": StringIsPrintable,
1237+
"Basic data handling: StringIsSpace": StringIsSpace,
1238+
"Basic data handling: StringIsTitle": StringIsTitle,
1239+
"Basic data handling: StringIsUpper": StringIsUpper,
1240+
"Basic data handling: StringJoin": StringJoin,
1241+
"Basic data handling: StringLjust": StringLjust,
1242+
"Basic data handling: StringLower": StringLower,
1243+
"Basic data handling: StringLstrip": StringLstrip,
1244+
"Basic data handling: StringRemoveprefix": StringRemoveprefix,
1245+
"Basic data handling: StringRemovesuffix": StringRemovesuffix,
1246+
"Basic data handling: StringReplace": StringReplace,
1247+
"Basic data handling: StringRfind": StringRfind,
1248+
"Basic data handling: StringRjust": StringRjust,
1249+
"Basic data handling: StringRsplit": StringRsplit,
1250+
"Basic data handling: StringRstrip": StringRstrip,
1251+
"Basic data handling: StringSplit": StringSplit,
1252+
"Basic data handling: StringSplitlines": StringSplitlines,
1253+
"Basic data handling: StringStartswith": StringStartswith,
1254+
"Basic data handling: StringStrip": StringStrip,
1255+
"Basic data handling: StringSwapcase": StringSwapcase,
1256+
"Basic data handling: StringTitle": StringTitle,
1257+
"Basic data handling: StringUpper": StringUpper,
1258+
"Basic data handling: StringZfill": StringZfill,
12591259
}
12601260

12611261
NODE_DISPLAY_NAME_MAPPINGS = {
1262-
"StringCapitalize": "capitalize",
1263-
"StringCasefold": "casefold",
1264-
"StringCenter": "center",
1265-
"DataStringConcat": "concat",
1266-
"StringCount": "count",
1267-
"StringDecode": "decode",
1268-
"StringEncode": "encode",
1269-
"StringExpandtabs": "expandtabs",
1270-
"StringEndswith": "endswith",
1271-
"StringFind": "find",
1272-
"StringFormatMap": "format_map",
1273-
"StringIn": "in (contains)",
1274-
"StringIsAlnum": "isalnum",
1275-
"StringIsAlpha": "isalpha",
1276-
"StringIsAscii": "isascii",
1277-
"StringIsDecimal": "isdecimal",
1278-
"StringIsDigit": "isdigit",
1279-
"StringIsIdentifier": "isidentifier",
1280-
"StringIsLower": "islower",
1281-
"StringIsNumeric": "isnumeric",
1282-
"StringIsPrintable": "isprintable",
1283-
"StringIsSpace": "isspace",
1284-
"StringIsTitle": "istitle",
1285-
"StringIsUpper": "isupper",
1286-
"StringJoin": "join",
1287-
"StringLjust": "ljust",
1288-
"StringLower": "lower",
1289-
"StringLstrip": "lstrip",
1290-
"StringRemoveprefix": "removeprefix",
1291-
"StringRemovesuffix": "removesuffix",
1292-
"StringReplace": "replace",
1293-
"StringRfind": "rfind",
1294-
"StringRjust": "rjust",
1295-
"StringRsplit": "rsplit",
1296-
"StringRstrip": "rstrip",
1297-
"StringSplit": "split",
1298-
"StringSplitlines": "splitlines",
1299-
"StringStartswith": "startswith",
1300-
"StringStrip": "strip",
1301-
"StringSwapcase": "swapcase",
1302-
"StringTitle": "title",
1303-
"StringUpper": "upper",
1304-
"StringZfill": "zfill",
1262+
"Basic data handling: StringCapitalize": "capitalize",
1263+
"Basic data handling: StringCasefold": "casefold",
1264+
"Basic data handling: StringCenter": "center",
1265+
"Basic data handling: StringConcat": "concat",
1266+
"Basic data handling: StringCount": "count",
1267+
"Basic data handling: StringDecode": "decode",
1268+
"Basic data handling: StringEncode": "encode",
1269+
"Basic data handling: StringExpandtabs": "expandtabs",
1270+
"Basic data handling: StringEndswith": "endswith",
1271+
"Basic data handling: StringFind": "find",
1272+
"Basic data handling: StringFormatMap": "format_map",
1273+
"Basic data handling: StringIn": "in (contains)",
1274+
"Basic data handling: StringIsAlnum": "isalnum",
1275+
"Basic data handling: StringIsAlpha": "isalpha",
1276+
"Basic data handling: StringIsAscii": "isascii",
1277+
"Basic data handling: StringIsDecimal": "isdecimal",
1278+
"Basic data handling: StringIsDigit": "isdigit",
1279+
"Basic data handling: StringIsIdentifier": "isidentifier",
1280+
"Basic data handling: StringIsLower": "islower",
1281+
"Basic data handling: StringIsNumeric": "isnumeric",
1282+
"Basic data handling: StringIsPrintable": "isprintable",
1283+
"Basic data handling: StringIsSpace": "isspace",
1284+
"Basic data handling: StringIsTitle": "istitle",
1285+
"Basic data handling: StringIsUpper": "isupper",
1286+
"Basic data handling: StringJoin": "join",
1287+
"Basic data handling: StringLjust": "ljust",
1288+
"Basic data handling: StringLower": "lower",
1289+
"Basic data handling: StringLstrip": "lstrip",
1290+
"Basic data handling: StringRemoveprefix": "removeprefix",
1291+
"Basic data handling: StringRemovesuffix": "removesuffix",
1292+
"Basic data handling: StringReplace": "replace",
1293+
"Basic data handling: StringRfind": "rfind",
1294+
"Basic data handling: StringRjust": "rjust",
1295+
"Basic data handling: StringRsplit": "rsplit",
1296+
"Basic data handling: StringRstrip": "rstrip",
1297+
"Basic data handling: StringSplit": "split",
1298+
"Basic data handling: StringSplitlines": "splitlines",
1299+
"Basic data handling: StringStartswith": "startswith",
1300+
"Basic data handling: StringStrip": "strip",
1301+
"Basic data handling: StringSwapcase": "swapcase",
1302+
"Basic data handling: StringTitle": "title",
1303+
"Basic data handling: StringUpper": "upper",
1304+
"Basic data handling: StringZfill": "zfill",
13051305
}

tests/test_string_nodes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
StringCapitalize,
55
StringCasefold,
66
StringCenter,
7-
DataStringConcat,
7+
StringConcat,
88
StringCount,
99
StringDecode,
1010
StringEncode,
@@ -72,7 +72,7 @@ def test_center():
7272
assert node.center("test", 10, "ab") == ("aaatestaaa",)
7373

7474
def test_concat():
75-
node = DataStringConcat()
75+
node = StringConcat()
7676
assert node.concat("hello ", "world") == ("hello world",)
7777
assert node.concat("", "") == ("",) # Empty strings
7878
assert node.concat("123", "456") == ("123456",) # Numbers as strings

0 commit comments

Comments
 (0)