-
-
Notifications
You must be signed in to change notification settings - Fork 438
Add testing support #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
a5ffada
55775c2
3fb442c
11a357f
f4c2e8e
e1ba7e2
80ec766
d583916
87d535b
c9423fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| VERSION: str = '9.2.0' # Major.Minor.Patch | ||
| VERSION_BRANCH: str = 'Alpha' # 'Alpha', 'Beta', or '' for Full Release | ||
|
|
||
| # The folder & file names where TagStudio keeps its data relative to a library. | ||
| TS_FOLDER_NAME: str = '.TagStudio' | ||
| BACKUP_FOLDER_NAME: str = 'backups' | ||
| COLLAGE_FOLDER_NAME: str = 'collages' | ||
| LIBRARY_FILENAME: str = 'ts_library.json' | ||
|
|
||
| # TODO: Turn this whitelist into a user-configurable blacklist. | ||
| IMAGE_TYPES: list[str] = ['png', 'jpg', 'jpeg', 'jpg_large', 'jpeg_large', | ||
| 'jfif', 'gif', 'tif', 'tiff', 'heic', 'heif', 'webp', | ||
| 'bmp', 'svg', 'avif', 'apng', 'jp2', 'j2k', 'jpg2'] | ||
| VIDEO_TYPES: list[str] = ['mp4', 'webm', 'mov', 'hevc', 'mkv', 'avi', 'wmv', | ||
| 'flv', 'gifv', 'm4p', 'm4v', '3gp'] | ||
| AUDIO_TYPES: list[str] = ['mp3', 'mp4', 'mpeg4', 'm4a', 'aac', 'wav', 'flac', | ||
| 'alac', 'wma', 'ogg', 'aiff'] | ||
| DOC_TYPES: list[str] = ['txt', 'rtf', 'md', | ||
| 'doc', 'docx', 'pdf', 'tex', 'odt', 'pages'] | ||
| PLAINTEXT_TYPES: list[str] = ['txt', 'md', 'css', 'html', 'xml', 'json', 'js', | ||
| 'ts', 'ini', 'htm', 'csv', 'php', 'sh', 'bat'] | ||
| SPREADSHEET_TYPES: list[str] = ['csv', 'xls', 'xlsx', 'numbers', 'ods'] | ||
| PRESENTATION_TYPES: list[str] = ['ppt', 'pptx', 'key', 'odp'] | ||
| ARCHIVE_TYPES: list[str] = ['zip', 'rar', 'tar', 'tar.gz', 'tgz', '7z'] | ||
| PROGRAM_TYPES: list[str] = ['exe', 'app'] | ||
| SHORTCUT_TYPES: list[str] = ['lnk', 'desktop', 'url'] | ||
|
|
||
| ALL_FILE_TYPES: list[str] = IMAGE_TYPES + VIDEO_TYPES + AUDIO_TYPES + \ | ||
| DOC_TYPES + SPREADSHEET_TYPES + PRESENTATION_TYPES + \ | ||
| ARCHIVE_TYPES + PROGRAM_TYPES + SHORTCUT_TYPES | ||
|
|
||
| BOX_FIELDS = ['tag_box', 'text_box'] | ||
| TEXT_FIELDS = ['text_line', 'text_box'] | ||
| DATE_FIELDS = ['datetime'] | ||
|
|
||
| TAG_COLORS = ['', 'black', 'dark gray', 'gray', 'light gray', 'white', 'light pink', | ||
| 'pink', 'red', 'red orange', 'orange', 'yellow orange', 'yellow', | ||
| 'lime', 'light green', 'mint', 'green','teal', 'cyan', 'light blue', | ||
| 'blue', 'blue violet', 'violet', 'purple', 'lavender', 'berry', | ||
| 'magenta', 'salmon', 'auburn', 'dark brown', 'brown', 'light brown', | ||
| 'blonde', 'peach', 'warm gray', 'cool gray', 'olive'] |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,50 +7,8 @@ | |||||||||
| import json | ||||||||||
| import os | ||||||||||
|
|
||||||||||
| from src.core.library import Entry, Library | ||||||||||
|
|
||||||||||
| VERSION: str = '9.2.0' # Major.Minor.Patch | ||||||||||
| VERSION_BRANCH: str = 'Alpha' # 'Alpha', 'Beta', or '' for Full Release | ||||||||||
|
|
||||||||||
| # The folder & file names where TagStudio keeps its data relative to a library. | ||||||||||
| TS_FOLDER_NAME: str = '.TagStudio' | ||||||||||
| BACKUP_FOLDER_NAME: str = 'backups' | ||||||||||
| COLLAGE_FOLDER_NAME: str = 'collages' | ||||||||||
| LIBRARY_FILENAME: str = 'ts_library.json' | ||||||||||
|
|
||||||||||
| # TODO: Turn this whitelist into a user-configurable blacklist. | ||||||||||
| IMAGE_TYPES: list[str] = ['png', 'jpg', 'jpeg', 'jpg_large', 'jpeg_large', | ||||||||||
| 'jfif', 'gif', 'tif', 'tiff', 'heic', 'heif', 'webp', | ||||||||||
| 'bmp', 'svg', 'avif', 'apng', 'jp2', 'j2k', 'jpg2'] | ||||||||||
| VIDEO_TYPES: list[str] = ['mp4', 'webm', 'mov', 'hevc', 'mkv', 'avi', 'wmv', | ||||||||||
| 'flv', 'gifv', 'm4p', 'm4v', '3gp'] | ||||||||||
| AUDIO_TYPES: list[str] = ['mp3', 'mp4', 'mpeg4', 'm4a', 'aac', 'wav', 'flac', | ||||||||||
| 'alac', 'wma', 'ogg', 'aiff'] | ||||||||||
| DOC_TYPES: list[str] = ['txt', 'rtf', 'md', | ||||||||||
| 'doc', 'docx', 'pdf', 'tex', 'odt', 'pages'] | ||||||||||
| PLAINTEXT_TYPES: list[str] = ['txt', 'md', 'css', 'html', 'xml', 'json', 'js', | ||||||||||
| 'ts', 'ini', 'htm', 'csv', 'php', 'sh', 'bat'] | ||||||||||
| SPREADSHEET_TYPES: list[str] = ['csv', 'xls', 'xlsx', 'numbers', 'ods'] | ||||||||||
| PRESENTATION_TYPES: list[str] = ['ppt', 'pptx', 'key', 'odp'] | ||||||||||
| ARCHIVE_TYPES: list[str] = ['zip', 'rar', 'tar', 'tar.gz', 'tgz', '7z'] | ||||||||||
| PROGRAM_TYPES: list[str] = ['exe', 'app'] | ||||||||||
| SHORTCUT_TYPES: list[str] = ['lnk', 'desktop', 'url'] | ||||||||||
|
|
||||||||||
| ALL_FILE_TYPES: list[str] = IMAGE_TYPES + VIDEO_TYPES + AUDIO_TYPES + \ | ||||||||||
| DOC_TYPES + SPREADSHEET_TYPES + PRESENTATION_TYPES + \ | ||||||||||
| ARCHIVE_TYPES + PROGRAM_TYPES + SHORTCUT_TYPES | ||||||||||
|
|
||||||||||
| BOX_FIELDS = ['tag_box', 'text_box'] | ||||||||||
| TEXT_FIELDS = ['text_line', 'text_box'] | ||||||||||
| DATE_FIELDS = ['datetime'] | ||||||||||
|
|
||||||||||
| TAG_COLORS = ['', 'black', 'dark gray', 'gray', 'light gray', 'white', 'light pink', | ||||||||||
| 'pink', 'red', 'red orange', 'orange', 'yellow orange', 'yellow', | ||||||||||
| 'lime', 'light green', 'mint', 'green','teal', 'cyan', 'light blue', | ||||||||||
| 'blue', 'blue violet', 'violet', 'purple', 'lavender', 'berry', | ||||||||||
| 'magenta', 'salmon', 'auburn', 'dark brown', 'brown', 'light brown', | ||||||||||
| 'blonde', 'peach', 'warm gray', 'cool gray', 'olive'] | ||||||||||
|
|
||||||||||
| from tagstudio.src.core.constants import TEXT_FIELDS | ||||||||||
| from tagstudio.src.core.library import Entry, Library | ||||||||||
|
||||||||||
| from tagstudio.src.core.constants import TEXT_FIELDS | |
| from tagstudio.src.core.library import Entry, Library | |
| from src.core.constants import TEXT_FIELDS | |
| from src.core.library import Entry, Library |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback! I have made the changes.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -36,16 +36,17 @@ | |||||||||||||||||
| QMenu, QTableWidget, QTableWidgetItem) | ||||||||||||||||||
| from humanfriendly import format_timespan, format_size | ||||||||||||||||||
|
|
||||||||||||||||||
| from src.core.library import Collation, Entry, ItemType, Library, Tag | ||||||||||||||||||
| from src.core.palette import ColorType, get_tag_color | ||||||||||||||||||
| from src.core.ts_core import (PLAINTEXT_TYPES, TagStudioCore, TAG_COLORS, DATE_FIELDS, TEXT_FIELDS, BOX_FIELDS, ALL_FILE_TYPES, | ||||||||||||||||||
| from tagstudio.src.core.library import Collation, Entry, ItemType, Library, Tag | ||||||||||||||||||
|
||||||||||||||||||
| from tagstudio.src.core.palette import ColorType, get_tag_color | ||||||||||||||||||
|
||||||||||||||||||
| from tagstudio.src.core.ts_core import TagStudioCore | ||||||||||||||||||
| from tagstudio.src.core.constants import (PLAINTEXT_TYPES, TAG_COLORS, DATE_FIELDS, TEXT_FIELDS, BOX_FIELDS, ALL_FILE_TYPES, | ||||||||||||||||||
|
||||||||||||||||||
| from tagstudio.src.core.library import Collation, Entry, ItemType, Library, Tag | |
| from tagstudio.src.core.palette import ColorType, get_tag_color | |
| from tagstudio.src.core.ts_core import TagStudioCore | |
| from tagstudio.src.core.constants import (PLAINTEXT_TYPES, TAG_COLORS, DATE_FIELDS, TEXT_FIELDS, BOX_FIELDS, ALL_FILE_TYPES, | |
| from src.core.library import Collation, Entry, ItemType, Library, Tag | |
| from src.core.palette import ColorType, get_tag_color | |
| from src.core.ts_core import TagStudioCore | |
| from src.core.constants import (PLAINTEXT_TYPES, TAG_COLORS, DATE_FIELDS, TEXT_FIELDS, BOX_FIELDS, ALL_FILE_TYPES, |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tagstudio.src... import format breaks at runtime for vscode and when running from the terminal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback! I have made the changes.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import unittest | ||
|
|
||
| if __name__ == '__main__': | ||
| """Runs every test.""" | ||
| test_loader = unittest.TestLoader() | ||
| test_suite = test_loader.discover(start_dir='src', pattern='test_*.py') | ||
|
|
||
| runner = unittest.TextTestRunner() | ||
| result = runner.run(test_suite) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,12 +1,14 @@ | ||||||
| from src.core.library import Tag | ||||||
| import unittest | ||||||
|
|
||||||
| from tagstudio.src.core.library import Tag | ||||||
|
||||||
| from tagstudio.src.core.library import Tag | |
| from src.core.library import Tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback! I have made the changes.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||
| import unittest | ||||||
|
|
||||||
| from parameterized import parameterized | ||||||
|
|
||||||
| from tagstudio.src.core.utils.str import strip_punctuation | ||||||
|
||||||
| from tagstudio.src.core.utils.str import strip_punctuation | |
| from src.core.utils.str import strip_punctuation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback! I have made the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tagstudio.src...import format breaks at runtime for vscode and when running from the terminalThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback! I have made the changes.