-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #482 from NeurodataWithoutBorders/enh/analysis
final changes before minor release
- Loading branch information
Showing
10 changed files
with
97 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import unittest2 as unittest | ||
|
||
from pynwb.form.container import Container | ||
|
||
|
||
class MyTestClass(Container): | ||
|
||
def __init__(self, src, name, parent=None): | ||
super(MyTestClass, self).__init__(src, name, parent=parent) | ||
|
||
def basic_add(self, **kwargs): | ||
return kwargs | ||
|
||
def basic_add2(self, **kwargs): | ||
return kwargs | ||
|
||
def basic_add2_kw(self, **kwargs): | ||
return kwargs | ||
|
||
|
||
class MyTestSubclass(MyTestClass): | ||
|
||
def basic_add(self, **kwargs): | ||
return kwargs | ||
|
||
def basic_add2_kw(self, **kwargs): | ||
return kwargs | ||
|
||
|
||
class TestNWBContainer(unittest.TestCase): | ||
|
||
def test_constructor(self): | ||
"""Test that constructor properly sets parent | ||
""" | ||
parent_obj = MyTestClass('test source', 'obj1') | ||
child_obj = MyTestSubclass('test source', 'obj2', parent=parent_obj) | ||
self.assertIs(child_obj.parent, parent_obj) | ||
|
||
def test_set_parent_parent(self): | ||
"""Test that parent setter properly sets parent | ||
""" | ||
parent_obj = MyTestClass('test source', 'obj1') | ||
child_obj = MyTestSubclass('test source', 'obj2') | ||
child_obj.parent = parent_obj | ||
self.assertIs(child_obj.parent, parent_obj) | ||
|
||
def test_slash_restriction(self): | ||
self.assertRaises(ValueError, Container, 'bad/name') | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters