[Abtlinux-svn] SF.net SVN: abtlinux: [409] src/trunk/testabtdownloadmanager.rb
Status: Alpha
Brought to you by:
eschabell
From: <esc...@us...> - 2007-07-24 12:53:15
|
Revision: 409 http://svn.sourceforge.net/abtlinux/?rev=409&view=rev Author: eschabell Date: 2007-07-24 05:53:06 -0700 (Tue, 24 Jul 2007) Log Message: ----------- Refactored to ensure proper test coverage. Big improvement is that test package ipc sources are no longer downloaded. Modified Paths: -------------- src/trunk/testabtdownloadmanager.rb Modified: src/trunk/testabtdownloadmanager.rb =================================================================== --- src/trunk/testabtdownloadmanager.rb 2007-07-24 12:46:48 UTC (rev 408) +++ src/trunk/testabtdownloadmanager.rb 2007-07-24 12:53:06 UTC (rev 409) @@ -34,7 +34,9 @@ # setup method for testing AbtDownloadManager. ## def setup - @download = AbtDownloadManager.new() + @download = AbtDownloadManager.new + @manager = AbtPackageManager.new + @system = AbtSystemManager.new end ## @@ -47,8 +49,10 @@ # Test method for 'AbtDownloadManager.test_retrieve_package_source()' ## def test_retrieve_package_source() - assert( - @download.retrieve_package_source( "ipc", "#{$SOURCES_REPOSITORY}" ), "test_retrieve_package_source()" ) + # ensures download not needed. + FileUtils.cp "#{$PACKAGE_PATH}/ipc-1.4.tar.gz", "#{$SOURCES_REPOSITORY}", :verbose => true if !File.exist?( "#{$SOURCES_REPOSITORY}/ipc-1.4.tar.gz" ) + + assert( @download.retrieve_package_source( "ipc", "#{$SOURCES_REPOSITORY}" ), "test_retrieve_package_source()" ) end ## @@ -83,6 +87,9 @@ # Test method for 'AbtDownloadManager.test_validated()' ## def test_validated() + # ensure a tarball is available to test! + FileUtils.cp "#{$PACKAGE_PATH}/ipc-1.4.tar.gz", "#{$SOURCES_REPOSITORY}", :verbose => true if !File.exist?( "#{$SOURCES_REPOSITORY}/ipc-1.4.tar.gz" ) + assert( @download.validated( 'e81278607b1d65dcb18c3613ec00fbf588b50319', "#{$SOURCES_REPOSITORY}/ipc-1.4.tar.gz" ), "test_validated" ) end end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |