def test_update_new_dids(self): """ DATA IDENTIFIERS (API): List new identifiers and update the flag new """ tmp_scope = scope_name_generator() tmp_dsn = 'dsn_%s' % generate_uuid() scope.add_scope(tmp_scope, 'jdoe', 'jdoe') dids = [] for i in xrange(0, 5): d = { 'scope': tmp_scope, 'name': '%s-%i' % (tmp_dsn, i), 'did_type': DIDType.DATASET } did.add_did(scope=tmp_scope, name='%s-%i' % (tmp_dsn, i), type='DATASET', issuer='root') dids.append(d) st = did.set_new_dids(dids, None) assert_true(st) with assert_raises(DataIdentifierNotFound): did.set_new_dids([{ 'scope': 'dummyscope', 'name': 'dummyname', 'did_type': DIDType.DATASET }], None)
def test_update_new_dids(self): """ DATA IDENTIFIERS (API): List new identifiers and update the flag new """ tmp_scope = scope_name_generator() tmp_dsn = 'dsn_%s' % generate_uuid() scope.add_scope(tmp_scope, 'jdoe', 'jdoe') dids = [] for i in xrange(0, 5): d = {'scope': tmp_scope, 'name': '%s-%i' % (tmp_dsn, i), 'did_type': DIDType.DATASET} did.add_did(scope=tmp_scope, name='%s-%i' % (tmp_dsn, i), type='DATASET', issuer='root') dids.append(d) st = did.set_new_dids(dids, None) assert_true(st) with assert_raises(DataIdentifierNotFound): did.set_new_dids([{'scope': 'dummyscope', 'name': 'dummyname', 'did_type': DIDType.DATASET}], None)