Skip to content
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

869 - Update test_create_portal_metadata to use assertProjectReadmeContent #892

Conversation

nozomione
Copy link
Member

Issue Number

Closing #869

Purpose/Implementation Notes

I've update the create_portal_metadata management command test to use the new assertProjectReadmeContent method.

Changes include:

  • Generated test_data/readmes/PORTAL_ALL_METADATA.md
  • Renamed the common.PORTAL_METADATA_COMPUTED_FILE_NAME value from portal_metadata.zip to PORTAL_ALL_METADATA.zip
  • Adjusted the regex pattern in assertProjectReadmeContent (made it more explicit for PROJECTID_)
  • Replaced assertProjectReadmeContains with assertProjectReadmeContent in test_create_portal_metadata
  • Adjusted templates/readme/contents/METADATA_ONLY.md to produce the valid readme output

Types of changes

  • Refactor (addresses code organization and design mentioned in corresponding issue)

Functional tests

N/A

Checklist

  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Screenshots

N/A

…nten, update regex pattern in assertProjectReadmeContent, generate test_data/readmes/PORTAL_ALL_METADATA.md, update the value of common.PORTAL_METADATA_COMPUTED_FILE_NAME from portal_metadata.zip to PORTAL_ALL_METADATA.zip
@nozomione nozomione added the API label Sep 11, 2024
@nozomione nozomione self-assigned this Sep 11, 2024
@nozomione nozomione linked an issue Sep 11, 2024 that may be closed by this pull request
@@ -73,7 +73,7 @@ def get_updated_content(content: str) -> str:
return content.strip()

# Get the corresponding saved readme output path based on the zip filename
readme_filename = re.sub(r"^[A-Z\d]+_", "", Path(zip_file.filename).stem) + ".md"
readme_filename = re.sub(r"^[A-Z]{5}\d{6}_", "", Path(zip_file.filename).stem) + ".md"
Copy link
Member Author

@nozomione nozomione Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made the regex pattern more explicit for IDs (e.g., SCPCP999990) and adjusted this file as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will remove this when we extract these checks into test_readme_file

@nozomione nozomione merged commit ebacc3e into dev Sep 11, 2024
5 checks passed
@nozomione nozomione deleted the nozomione/869-update-readme-assertion-method-for-test-create-portal-metadata branch September 11, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update test_create_portal_metadata to use assertProjectReadmeContent
2 participants