Skip to content

Section updates#271

Merged
jgrewe merged 32 commits intoG-Node:masterfrom
mpsonntag:secUpdate
Mar 29, 2018
Merged

Section updates#271
jgrewe merged 32 commits intoG-Node:masterfrom
mpsonntag:secUpdate

Conversation

@mpsonntag
Copy link
Copy Markdown
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
Copy Markdown

Coverage Status

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

@JuliaSprenger
Copy link
Copy Markdown
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
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.

5 participants