diff options
author | Oliver Tappe | 2008-01-07 15:58:13 +0100 |
---|---|---|
committer | Oliver Tappe | 2008-01-07 15:58:13 +0100 |
commit | 175275655abd8a7a3db3c3a1dfc5ee49a6488307 (patch) | |
tree | c0ce7654c9d9228e8bb7ff472cd99364f3d40176 /config-db/t/14-group.t | |
parent | more refactoring (not limited to attribute handling) (diff) | |
download | core-175275655abd8a7a3db3c3a1dfc5ee49a6488307.tar.gz core-175275655abd8a7a3db3c3a1dfc5ee49a6488307.tar.xz core-175275655abd8a7a3db3c3a1dfc5ee49a6488307.zip |
* finished refactoring of attribute handling code, especially the
merging of attributes, such that all tests are passed
* tested and finished implementation of group support in slxconfig
* added new class AttributeRoster which keeps track of the known
attributes (the ones provided by the openslx core and any other
ones that may have been added by some plugin).
* added new option --list-attributes to slxconfig which shows information
about all known attributes
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1444 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db/t/14-group.t')
-rw-r--r-- | config-db/t/14-group.t | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/config-db/t/14-group.t b/config-db/t/14-group.t index 59530257..b06620ce 100644 --- a/config-db/t/14-group.t +++ b/config-db/t/14-group.t @@ -339,6 +339,33 @@ is($group1->{name}, q{GRP-'1'}, q{really got group named "GRP-'1'"}); # changing nothing at all should succeed ok($configDB->changeGroup(1), 'changing nothing at all in group 1'); +# adding attributes should work +$inGroup1->{attrs}->{slxgrp} = 'slxgrp1'; +$inGroup1->{attrs}->{vmware} = 'yes'; +ok($configDB->changeGroup(1, $inGroup1), 'adding attrs to group 1'); +$group1 = $configDB->fetchGroupByID(1); +is($group1->{attrs}->{slxgrp}, 'slxgrp1', 'attr slxgrp has correct value'); +is($group1->{attrs}->{vmware}, 'yes', 'attr vmware has correct value'); + +# changing an attribute should work +$inGroup1->{attrs}->{vmware} = 'no'; +ok($configDB->changeGroup(1, $inGroup1), 'changing vmware in group 1'); +$group1 = $configDB->fetchGroupByID(1); +is($group1->{attrs}->{slxgrp}, 'slxgrp1', 'attr slxgrp has correct value'); +is($group1->{attrs}->{vmware}, 'no', 'attr vmware has correct value'); + +# deleting an attribute should remove it +delete $inGroup1->{attrs}->{slxgrp}; +ok($configDB->changeGroup(1, $inGroup1), 'changing slxgrp in group 1'); +$group1 = $configDB->fetchGroupByID(1); +ok(!exists $group1->{attrs}->{slxgrp}, 'attr slxgrp should be gone'); + +# undef'ing an attribute should remove it, too +$inGroup1->{attrs}->{vmware} = undef; +ok($configDB->changeGroup(1, $inGroup1), 'undefining vmware in group 1'); +$group1 = $configDB->fetchGroupByID(1); +ok(!exists $group1->{attrs}->{vmware}, 'attr vmware should be gone'); + # changing a non-existing column should fail ok( ! eval { $configDB->changeGroup(1, { xname => "xx" }) }, |