def setup_module(): cfg.dse_keyspace = TEST_KEYSPACE initialise() connect() create_tables() create_default_users() create_root()
def setup_module(): cfg.dse_keyspace = TEST_KEYSPACE initialise() connect() create_tables() create_default_users() create_root() grp1 = Group.create(name=GRP1_NAME) grp2 = Group.create(name=GRP2_NAME) grp3 = Group.create(name=GRP3_NAME) user_name = USR1_NAME email = uuid.uuid4().hex password = uuid.uuid4().hex administrator = True groups = [GRP1_NAME] user1 = User.create(name=user_name, email=email, password=password, administrator=administrator, groups=groups) user_name = USR2_NAME email = uuid.uuid4().hex password = uuid.uuid4().hex administrator = False groups = [GRP1_NAME, GRP2_NAME] user2 = User.create(name=user_name, email=email, password=password, administrator=administrator, groups=groups)
def setup_module(): cfg.dse_keyspace = TEST_KEYSPACE initialise() connect() create_tables() create_root() Group.create(name="grp1")
def test_update(): cfg.dse_keyspace = TEST_KEYSPACE connect() do = DataObject.create(TEST_CONTENT) do.update(blob=TEST_CONTENT) do = DataObject.find(do.uuid) assert do.blob == TEST_CONTENT do.delete()
def setup_module(): cfg.dse_keyspace = TEST_KEYSPACE initialise() connect() create_tables() create_root() try: coll = Collection.create("/", "coll1") ref1 = Resource.create("/", "test.url", url=TEST_URL) resc = Resource.create("/coll1", "test.txt") ref2 = Resource.create("/coll1", "test.url", url=TEST_URL) except: # If collections or resources already exist pass
def setup_module(): cfg.dse_keyspace = TEST_KEYSPACE initialise() connect() create_tables() create_default_users() create_root() pwd = uuid.uuid4().hex email = uuid.uuid4().hex grp1 = Group.create(name="grp1") u1 = User.create(name="user1", password=pwd, email=email, administrator=True) u2 = User.create(name="user2", password=pwd, email=email, administrator=False) grp1.add_users(["user2"]) try: coll = Collection.create("/", "1") coll = Collection.create("/1", "11") coll = Collection.create("/1", "12") coll = Collection.create("/1", "13") coll = Collection.create("/", "2") coll = Collection.create("/2", "21") coll = Collection.create("/2/21", "211") coll = Collection.create("/2/21", "212") r = Resource.create("/1/11", "a") r = Resource.create("/1/11", "b", url=TEST_URL) r = Resource.create("/1/12", "c") r = Resource.create("/1/13", "d") r = Resource.create("/2/21/211", "e") r = Resource.create("/2/21/212", "f") r = Resource.create("/", "g") except: # If collections or resources already exist pass