def test_003_double_add_same_bundle_should_fail(self):
     import uuid
     REPO_FILE = '/tmp/testedRepoDir%s' % uuid.uuid4().hex
     os.mkdir(REPO_FILE)
     
     try:
         # Allocate repository
         repo = ExperimentRepository(REPO_FILE, readOnly=False)
         
         eID1 = repo.addExperiment("ex1", 1)
         eID2 = repo.addExperiment("ex2")
         
         # add result
         repo.addBundle("bundle0", {eID1: 'hello', eID2:'world'})
         
         # re-add result. should raise
         self.assertRaises(Exception, 
                           repo.addBundle, "bundle0", {eID1: 'hello', eID2:'world'})
        
     finally:
         # remove the directory, to keep things clean
         shutil.rmtree(REPO_FILE)
    def test_003_double_add_same_bundle_should_fail(self):
        import uuid
        REPO_FILE = '/tmp/testedRepoDir%s' % uuid.uuid4().hex
        os.mkdir(REPO_FILE)

        try:
            # Allocate repository
            repo = ExperimentRepository(REPO_FILE, readOnly=False)

            eID1 = repo.addExperiment("ex1", 1)
            eID2 = repo.addExperiment("ex2")

            # add result
            repo.addBundle("bundle0", {eID1: 'hello', eID2: 'world'})

            # re-add result. should raise
            self.assertRaises(Exception, repo.addBundle, "bundle0", {
                eID1: 'hello',
                eID2: 'world'
            })

        finally:
            # remove the directory, to keep things clean
            shutil.rmtree(REPO_FILE)