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)
Exemple #2
0
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_root()
    Group.create(name="grp1")
Exemple #4
0
    def init(self):
        """Create the tables"""
        create_tables()
        create_root()
        create_default_users()

        session = self.create_session()
        self.save_session(session)
def test_creation():
    cfg.dse_keyspace = TEST_KEYSPACE
    initialise()
    create_tables()
    create_default_users()
    create_root()
    # Test creation if they already exist
    create_default_users()
    destroy()
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
Exemple #7
0
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