test(core): add unit tests for untested core modules #203

Open
clu wants to merge 9 commits from test/core-unit-tests into dev

9 Commits

Author SHA1 Message Date
clu
ceb3957f0c fix(test): add pytest-asyncio for async test support
All checks were successful
Test before pr merge / test-lint (pull_request) Successful in 7s
Test before pr merge / test (pull_request) Successful in 35s
Add pytest-asyncio==0.26.0 to core dev requirements and configure
asyncio_mode=auto in pyproject.toml to fix failing async tests in
service_test.py.
2026-04-13 19:47:48 +02:00
clu
27205022a5 test(core): extend coverage — console, errors, log, service, time, benchmark
Some checks failed
Test before pr merge / test-lint (pull_request) Successful in 8s
Test before pr merge / test (pull_request) Failing after 36s
Add missing test modules for previously untested core areas:
- console: ForegroundColorEnum, BackgroundColorEnum, Console methods
- errors: dependency_error, module_dependency_error
- log: LogLevel ordering/values, LogSettings, Logger (should_log, format, file write, fatal)
- service: HostedService, StartupTask, CronjobABC (start/stop/loop/task cancellation)
- time: TimeFormatSettings properties and setters
- utils: Benchmark.time / .memory / .all call-count and output

Also fix existing test files: environment cleanup, cron exception specificity,
json_processor kwargs bug doc, configuration_model_abc to_dict bug doc.
All 199 tests pass, black clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 19:34:52 +02:00
clu
82055ca6b5 test(core): add tests for Configuration and ConfigurationModelABC
All checks were successful
Test before pr merge / test-lint (pull_request) Successful in 8s
Test before pr merge / test (pull_request) Successful in 34s
- ConfigurationModelABC: defaults, src parsing, PascalCase/snake_case
  key variants, type casting, required fields, readonly enforcement,
  env var override with prefix
- Configuration: set/get by class and string key, auto-instantiation
  of unregistered models, add_json_file loading, optional/missing files

Also documents two additional bugs found:
- cast(True, bool) fails with AttributeError (bool has no .lower())
- add_json_file does not exit on invalid JSON (swallows parse error)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 19:23:07 +02:00
clu
cdca5614e8 style: apply black formatting to src
All checks were successful
Test before pr merge / test-lint (pull_request) Successful in 7s
Test before pr merge / test (pull_request) Successful in 35s
Auto-formatted 9 files that were failing the black lint check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 18:43:12 +02:00
clu
ca58f636ee test(core): add unit tests for untested core modules
Some checks failed
Test before pr merge / test-lint (pull_request) Failing after 13s
Test before pr merge / test (pull_request) Successful in 40s
Adds 113 tests covering:
- abc: RegistryABC (concrete implementation + edge cases)
- environment: Environment get/set, EnvironmentEnum
- pipes: BoolPipe, IPAddressPipe (incl. roundtrip + error cases)
- time: Cron (next(), intervals, invalid expression)
- utils: Cache (TTL, expiry, cleanup), get_value (incl. bug
  documentation: cast result not returned for string->typed values),
  JSONProcessor (nested objects, enums, defaults)
- property: classproperty (class access, instance access, subclass)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 18:40:01 +02:00
bcca7090d3 Updated requirements
All checks were successful
Build on push / prepare (push) Successful in 10s
Build on push / core (push) Successful in 19s
Build on push / query (push) Successful in 23s
Build on push / cli (push) Successful in 16s
Build on push / dependency (push) Successful in 18s
Build on push / translation (push) Successful in 21s
Build on push / mail (push) Successful in 22s
Build on push / application (push) Successful in 22s
Build on push / database (push) Successful in 22s
Build on push / auth (push) Successful in 16s
Build on push / api (push) Successful in 16s
2026-01-16 16:41:04 +01:00
8aeb381a91 Add .cpl to build
All checks were successful
Build on push / prepare (push) Successful in 10s
Build on push / query (push) Successful in 19s
Build on push / core (push) Successful in 20s
Build on push / dependency (push) Successful in 15s
Build on push / cli (push) Successful in 19s
Build on push / translation (push) Successful in 16s
Build on push / application (push) Successful in 20s
Build on push / database (push) Successful in 21s
Build on push / mail (push) Successful in 20s
Build on push / auth (push) Successful in 15s
Build on push / api (push) Successful in 15s
2026-01-16 16:35:45 +01:00
9cf5886902 Fixed master build
All checks were successful
Build on push / prepare (push) Successful in 23s
Build on push / core (push) Successful in 19s
Build on push / query (push) Successful in 23s
Build on push / cli (push) Successful in 15s
Build on push / dependency (push) Successful in 47s
Build on push / application (push) Successful in 15s
Build on push / mail (push) Successful in 19s
Build on push / translation (push) Successful in 19s
Build on push / database (push) Successful in 46s
Build on push / auth (push) Successful in 17s
Build on push / api (push) Successful in 16s
2026-01-16 16:27:32 +01:00
d60b281d6a Merge pull request 'dev into master' (#184) from dev into master
Some checks failed
Build on push / core (push) Has been cancelled
Build on push / query (push) Has been cancelled
Build on push / translation (push) Has been cancelled
Build on push / mail (push) Has been cancelled
Build on push / prepare (push) Has been cancelled
Reviewed-on: #184
2026-01-16 16:25:37 +01:00