Beispiel #1
0
def test_root_path(setup_groups):
    """Test the root path properties"""
    group_path = GroupPath()
    assert group_path.path == ''
    assert group_path.delimiter == '/'
    assert group_path.parent is None
    assert group_path.is_virtual
    assert group_path.get_group() is None
Beispiel #2
0
def test_group_retrieval(setup_groups):
    """Test retrieval of the actual group from a path.

    The ``group`` attribute will return None
    if no group is associated with the path
    """
    group_path = GroupPath()
    assert group_path['x'].is_virtual
    assert not group_path['a'].is_virtual
    assert group_path.get_group() is None
    assert isinstance(group_path['a'].get_group(), orm.Group)