Commit Graph

1 Commits

Author SHA1 Message Date
MiroFish Contributor f3eb616656 refactor: extract OasisAgentProfile to standalone oasis_models module
Extract OasisAgentProfile dataclass and helper functions to a new
oasis_models.py module that has no Flask dependencies. This allows
proper unit testing without mocking the entire app package.

Changes:
- Create backend/app/services/oasis_models.py with OasisAgentProfile
  and helper functions (_generate_username, _normalize_gender,
  _is_individual_entity, _is_group_entity)
- Update oasis_profile_generator.py to import from oasis_models
- Create backend/tests/test_oasis_profile.py that imports the real
  OasisAgentProfile instead of using an inline copy
- Add pytest.ini and conftest.py for test configuration

This fixes the bug where tests were testing a copy of the class
rather than the actual production code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 20:25:22 +08:00