diff options
author | Oliver Tappe | 2007-12-16 16:27:43 +0100 |
---|---|---|
committer | Oliver Tappe | 2007-12-16 16:27:43 +0100 |
commit | 5ffdf45ad2ac31302cf3c4b3d6ecb27f4ffffe32 (patch) | |
tree | b6c12674f8e7b559eaa76543d1850380f0bcba7c /config-db/t/10-vendor-os.t | |
parent | Revert test commit. (diff) | |
download | core-5ffdf45ad2ac31302cf3c4b3d6ecb27f4ffffe32.tar.gz core-5ffdf45ad2ac31302cf3c4b3d6ecb27f4ffffe32.tar.xz core-5ffdf45ad2ac31302cf3c4b3d6ecb27f4ffffe32.zip |
* completed regression tests for vendor-OSes
* added regression tests for exports, systems and clients
* fixed several bugs found by these tests
* cosmetical cleanups in ConfigDB.pm
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1431 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db/t/10-vendor-os.t')
-rw-r--r-- | config-db/t/10-vendor-os.t | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/config-db/t/10-vendor-os.t b/config-db/t/10-vendor-os.t index 9f7c9f11..b0754be7 100644 --- a/config-db/t/10-vendor-os.t +++ b/config-db/t/10-vendor-os.t @@ -12,6 +12,15 @@ is( my $vendorOS = $configDB->fetchVendorOSByFilter, undef, 'no vendor-OS yet (scalar context)' ); + +my $wrongVendorOS = { + 'comment' => 'test', +}; +ok( + ! eval { my $vendorOSID = $configDB->addVendorOS($wrongVendorOS); }, + 'trying to insert an unnamed vendor-OS should fail' +); + is( my @vendorOSes = $configDB->fetchVendorOSByFilter, 0, 'no vendor-OS yet (array context)' @@ -173,7 +182,13 @@ ok( 'changing unknown colum should fail' ); -ok($configDB->changeVendorOS(1, { id => 23 }), 'changing id should fail'); +ok(! $configDB->changeVendorOS(1, { id => 23 }), 'changing id should fail'); + +# now remove a vendor-OS and check if that worked +ok($configDB->removeVendorOS(3), 'removing vendor-OS 3 should be ok'); +is($configDB->fetchVendorOSByID(3, 'id'), undef, 'vendor-OS 3 should be gone'); +is($configDB->fetchVendorOSByID(1)->{id}, 1, 'vendor-OS 1 should still exist'); +is($configDB->fetchVendorOSByID(2)->{id}, 2, 'vendor-OS 2 should still exist'); $configDB->disconnect(); |