Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Section updates #271

Merged
merged 32 commits into from
Mar 29, 2018
Merged

Section updates #271

merged 32 commits into from
Mar 29, 2018

Conversation

mpsonntag
Copy link
Contributor

This PR updates Section methods and adds many tests.

  • reorder is moved from base to Section since it makes no sense to have it in Document or Property. Closes Refactor reorder() method #267.
  • Adds an extend method for child Sections and Properties. Closes change value related behaviors #237.
  • Appending multiple Sections or Properties has been removed from the append method to mirror Property append functionality and since extend now serves this need.
  • Changes __init__ set attributes order: In the previous set attribute order, the repository attribute was overwritten with None by the super.__init__ after it had been set.
  • Adds strict flag to merge method. Closes Add section.merge() strict keyword #270.
  • Fixes set parent = None bugs in remove and insert.
  • Adds a name check for existing child on insert.
  • Adds various section and section save/load tests.

Don't be afraid, its mainly tests!

Closes G-Node#267

reorder makes only sense in the scope of a section.
Therefore it is moved from base to section proper.
In the previous set attribute order, the repository
attribute was overwritten with None by the super.__init__
after it had been set.
The case of the single test in this testfile is
covered by the 'append' test in test_section.
Appending multiple Sections or Properties has been
removed to mirror Property append functionality and
since extend already serves this need.
@coveralls
Copy link

Coverage Status

Coverage increased (+1.2%) to 73.625% when pulling 31b8ff1 on mpsonntag:secUpdate into 9d8af75 on G-Node:master.

@JuliaSprenger
Copy link
Contributor

I tested the append and extend functionality, which works fine for me. For the merge on section level, this does not consider additional attributes like the definition of a section. Do you think it would make sense in the strict=True case to check for matching definitions of sections?

@jgrewe jgrewe merged commit a66ecdf into G-Node:master Mar 29, 2018
@mpsonntag mpsonntag deleted the secUpdate branch March 29, 2018 14:09
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants