From 5ffdf45ad2ac31302cf3c4b3d6ecb27f4ffffe32 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 16 Dec 2007 15:27:43 +0000 Subject: * 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 --- config-db/t/10-vendor-os.t | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'config-db/t/10-vendor-os.t') 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(); -- cgit v1.2.3-55-g7522