Skip to content

Commit 3713ba4

Browse files
authored
Merge pull request #19 from workflowai/guillaume/image-file
Export File field
2 parents 19d6f2d + 9c06ca8 commit 3713ba4

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "workflowai"
3-
version = "0.3.3"
3+
version = "0.3.4"
44
description = ""
55
authors = ["Guillaume Aquilina <[email protected]>"]
66
readme = "README.md"

workflowai/fields.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from workflowai.core.fields.chat_message import ChatMessage as ChatMessage
22
from workflowai.core.fields.email_address import EmailAddressStr as EmailAddressStr
3+
from workflowai.core.fields.file import File as File
34
from workflowai.core.fields.html_string import HTMLString as HTMLString
45
from workflowai.core.fields.http_url import HttpUrl as HttpUrl
56
from workflowai.core.fields.image import Image as Image

workflowai/fields_test.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import os
2+
3+
from workflowai import fields
4+
5+
6+
def test_exported_fields_match_core_fields():
7+
# Get the number of exported fields in fields.py
8+
exported_fields = {attr for attr in dir(fields) if not attr.startswith("_")}
9+
10+
# Get the number of files in workflowai/core/fields
11+
core_fields_dir = os.path.join(os.path.dirname(__file__), "core", "fields")
12+
core_field_files = {
13+
"".join(word.capitalize() for word in f.removesuffix(".py").split("_"))
14+
for f in os.listdir(core_fields_dir)
15+
if f.endswith(".py") and f != "__init__.py" and not f.endswith("_test.py")
16+
}
17+
18+
assert len(core_field_files) == len(exported_fields)

0 commit comments

Comments
 (0)