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

Add support for different file versions and update tests #63

Merged
merged 4 commits into from
Jul 9, 2024

Conversation

Ubham16
Copy link

@Ubham16 Ubham16 commented Jul 8, 2024

Add support for different file versions and update tests
Changed the code in schema.py to add

version: str = Field(
None,
alias="Version",
example="0.1.1",
description="BPX file version", )

And then changed the tests in schema
def test_missing_version(self):
test = copy.copy(self.base)
del test["Header"]["Version"]
parsed_obj = parse_obj_as(BPX, test)
self.assertIsNone(parsed_obj.header.version)

def test_invalid_version(self):
    test = copy.copy(self.base)
    test["Header"]["Version"] = 123  # Invalid type
    with self.assertRaises(ValidationError):
        parse_obj_as(BPX, test)

Copy link
Collaborator

@rtimms rtimms left a comment

Choose a reason for hiding this comment

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

thanks @Ubham16 the update to the schema looks good. looks like you didn't add the new test file?

@Ubham16 Ubham16 changed the base branch from main to develop July 9, 2024 18:01
@rtimms rtimms merged commit 6e24e15 into FaradayInstitution:develop Jul 9, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants