Skip to content

Commit

Permalink
add existing repo parents test
Browse files Browse the repository at this point in the history
can't add parents to an existing output repository
  • Loading branch information
Nate Pease committed Mar 15, 2017
1 parent e0c555c commit 5661e43
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/repositoryCfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ def testExistingParents(self):
self.assertEqual(len(butler._repos.outputs()), 1)
self.assertEqual(butler._repos.outputs()[0].cfg.root, os.path.join(ROOT, 'repositoryCfg/b'))

# can't add a new parent to an existing output
butler = dp.Butler(outputs=dp.RepositoryArgs(mode='w',
mapper=dpTest.EmptyTestMapper,
root=os.path.join(ROOT, 'repositoryCfg/c')))
with self.assertRaises(RuntimeError):
butler = dp.Butler(inputs=(os.path.join(ROOT, 'repositoryCfg/a'),
os.path.join(ROOT, 'repositoryCfg/c')),
outputs=os.path.join(ROOT, 'repositoryCfg/b'))


# "fake" repository version 0
class RepositoryCfg(yaml.YAMLObject):
Expand Down

0 comments on commit 5661e43

Please sign in to comment.