Skip to content

Remove unused Resource methods, add tests for existing methods#69

Merged
EdwardLarson merged 12 commits into
redballoonsecurity:masterfrom
whyitfor:maintenance/resource
Oct 17, 2022
Merged

Remove unused Resource methods, add tests for existing methods#69
EdwardLarson merged 12 commits into
redballoonsecurity:masterfrom
whyitfor:maintenance/resource

Conversation

@whyitfor
Copy link
Copy Markdown
Contributor

@whyitfor whyitfor commented Oct 7, 2022

Link to Related Issue(s)
N/A

Please describe the changes in your request.
This PR removed the following unused (and untested) publish methods from Resource:

  • get_data_index_within_parent
  • get_offset_within-root
  • get_data_unmapped_range
  • set_data_alignment
  • fetch
  • get_related_tags
  • get_all_attributes
  • move
  • get_siblings_as_view
  • get_siblings

Documentation is updated to reflect these changes. Specifically the "Advanced ResourceView Usage" section was removed. These removed APIs can be easily reintroduced in the future if they prove to be functionally useful and when they have test coverage.

Finally tests were added to ensure that all Resource public methods are tested.

The function test coverage for ofrak enforced in CI was bumped from 80 to 83.

Anyone you think should look at this, specifically?
No.

@whyitfor whyitfor force-pushed the maintenance/resource branch from b96078b to f0256ac Compare October 7, 2022 22:05
@whyitfor whyitfor requested a review from EdwardLarson October 7, 2022 22:12
Comment thread ofrak_core/ofrak/resource.py Outdated
Comment thread ofrak_core/ofrak/resource.py
Copy link
Copy Markdown
Contributor

@EdwardLarson EdwardLarson left a comment

Choose a reason for hiding this comment

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

Overlaps a bit with #40, not a problem, just pointing that out. Both PRs identified unnecessary interfaces.

@whyitfor whyitfor force-pushed the maintenance/resource branch from ca23b2d to 53a5cc5 Compare October 8, 2022 01:12
@whyitfor whyitfor requested a review from EdwardLarson October 11, 2022 21:39
@whyitfor whyitfor changed the title Remove unused, untested methods from Resource Remove unused Resource methods, add tests for existing methods Oct 11, 2022
@whyitfor
Copy link
Copy Markdown
Contributor Author

@EdwardLarson I've addressed the comments and updated the PR to include full function test coverage for Resource.

@EdwardLarson EdwardLarson merged commit 6e4f226 into redballoonsecurity:master Oct 17, 2022
@whyitfor whyitfor deleted the maintenance/resource branch October 29, 2022 00:18
whyitfor added a commit to whyitfor/ofrak that referenced this pull request Nov 17, 2022
- Remove Resource.get_offest_within_root, an unused method which was originally removed in redballoonsecurity#69
- Make abstract methods of ResourceViewInterface as such
whyitfor added a commit to whyitfor/ofrak that referenced this pull request Nov 17, 2022
- Remove Resource.get_offest_within_root, an unused method which was originally removed in redballoonsecurity#69
- Mark ResourceViewInterface methods as no cover. They are really abstract methods, but are not marked a such because ResourceViewInterface already has a metaclass
EdwardLarson pushed a commit that referenced this pull request Nov 17, 2022
- Remove Resource.get_offest_within_root, an unused method which was originally removed in #69
- Mark ResourceViewInterface methods as no cover. They are really abstract methods, but are not marked a such because ResourceViewInterface already has a metaclass
EdwardLarson pushed a commit to EdwardLarson/ofrak that referenced this pull request Aug 8, 2023
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