Sha256: b848e2d55a63d96ca188fceaf4b319f1ec6c577dc38f80689fd54292e54b7a59

Contents?: true

Size: 1.43 KB

Versions: 32

Compression:

Stored size: 1.43 KB

Contents

# To change this template, choose Tools | Templates
# and open the template in the editor.

$:.unshift File.join(File.dirname(__FILE__),'..','lib')

require 'test/unit'
require 'metamri/raw_image_dataset'
require 'metamri/raw_image_file'

class RawImageDatasetTest < Test::Unit::TestCase
  DBFILE = 'fixtures/development.sqlite3'
  
  def setup
    @aa = RawImageFile.new('fixtures/I.001')
    @bb = RawImageFile.new('fixtures/P27648.7')
    @cc = RawImageFile.new('fixtures/P59392.7')
    @dd = RawImageFile.new('fixtures/S4_EFGRE3D.0001')
    @dset = RawImageDataset.new('/Data/home/kris/NetBeansProjects/ImageData/test/fixtures', [@aa,@bb,@cc,@dd])
  end

  def test_raw_image_files
    assert_equal 4, @dset.raw_image_files.length
    assert_equal '"I.*"', @dset.glob
    assert_equal "SAG T2 W FSE 1.7 skip 0.3", @dset.series_description
    assert_equal "ALZMRI002", @dset.rmr_number
    assert_equal "2003-01-31T04:39:04+00:00", @dset.timestamp.to_s
    assert_equal "ALZMRI002::2003-01-31T04:39:04+00:00", @dset.dataset_key
    assert_equal "DELETE FROM image_datasets WHERE dataset_key = 'ALZMRI002::2003-01-31T04:39:04+00:00'", @dset.db_remove
  end
  
  def test_db_insertion
    assert_raise IndexError do
      @dset.db_insert!(DBFILE)
      @dset.db_insert!(DBFILE)
    end
  end
  
  def test_raw_image_insertion
    @dset.db_insert_raw_images!(DBFILE)
  end

  def teardown
    @dset.db_remove_raw_images!(DBFILE)
    @dset.db_remove!(DBFILE)
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
metamri-0.2.26 test/raw_image_dataset_test.rb
metamri-0.2.25 test/raw_image_dataset_test.rb
metamri-0.2.24 test/raw_image_dataset_test.rb
metamri-0.2.22 test/raw_image_dataset_test.rb
metamri-0.2.21 test/raw_image_dataset_test.rb
metamri-0.2.20 test/raw_image_dataset_test.rb
metamri-0.2.19 test/raw_image_dataset_test.rb
metamri-0.2.18 test/raw_image_dataset_test.rb
metamri-0.2.17 test/raw_image_dataset_test.rb
metamri-0.2.16 test/raw_image_dataset_test.rb
metamri-0.2.15 test/raw_image_dataset_test.rb
metamri-0.2.14 test/raw_image_dataset_test.rb
metamri-0.2.13 test/raw_image_dataset_test.rb
metamri-0.2.12 test/raw_image_dataset_test.rb
metamri-0.2.11 test/raw_image_dataset_test.rb
metamri-0.2.10 test/raw_image_dataset_test.rb
metamri-0.2.9 test/raw_image_dataset_test.rb
metamri-0.2.8 test/raw_image_dataset_test.rb
metamri-0.2.7 test/raw_image_dataset_test.rb
metamri-0.2.6 test/raw_image_dataset_test.rb