Skip to content

Commit

Permalink
Merge pull request #55 from lsst/tickets/DM-15159
Browse files Browse the repository at this point in the history
Add simple unit test of struct construction exception
  • Loading branch information
isullivan committed Jul 19, 2018
2 parents 852da13 + f285f21 commit 53a6ac1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ def testInit(self):
for name, val in self.valDict.items():
self.assertEqual(getattr(s, name), val)

def testInitException(self):
"""Test that struct key names cannot start with double underscores.
"""
with self.assertRaises(RuntimeError):
pipeBase.Struct(__foo=13)

def testSet(self):
"""Test adding values via struct.name=val
"""
Expand Down

0 comments on commit 53a6ac1

Please sign in to comment.