22# frozen_string_literal: true
33
44require "minitest/autorun"
5+ require_relative "test_helper"
6+ require "create_source_directory"
7+ require "preflight"
58require "postflight"
69
710class PostflightTest < Minitest ::Test
@@ -32,6 +35,8 @@ def self.gen_run
3235 shipment = shipment_class . new ( test_shipment . directory )
3336 stage = Preflight . new ( shipment , config : opts . merge ( @config ) )
3437 stage . run!
38+ stage = CreateSourceDirectory . new ( shipment , config : opts . merge ( @config ) )
39+ stage . run!
3540 stage = Postflight . new ( shipment , config : opts . merge ( @config ) )
3641 stage . run!
3742 assert_equal 0 , stage . errors . count , "stage runs without errors"
@@ -46,6 +51,8 @@ def self.gen_metadata_mismatch_removed
4651 shipment = shipment_class . new ( test_shipment . directory )
4752 stage = Preflight . new ( shipment , config : opts . merge ( @config ) )
4853 stage . run!
54+ stage = CreateSourceDirectory . new ( shipment , config : opts . merge ( @config ) )
55+ stage . run!
4956 FileUtils . rm_r ( File . join ( shipment . directory ,
5057 shipment . objid_to_path ( shipment . objids [ 0 ] ) ) ,
5158 force : true )
@@ -62,7 +69,7 @@ def self.gen_metadata_mismatch_added
6269 spec = "BC T bitonal 1 BC T bitonal 1"
6370 test_shipment = test_shipment_class . new ( dir , spec )
6471 shipment = shipment_class . new ( test_shipment . directory )
65- stage = Preflight . new ( shipment , config : opts . merge ( @config ) )
72+ stage = CreateSourceDirectory . new ( shipment , config : opts . merge ( @config ) )
6673 stage . run!
6774 new_objid = test_shipment_class . generate_objid
6875 FileUtils . mkdir_p File . join ( shipment . directory ,
@@ -79,7 +86,7 @@ def self.gen_feed_validate_error
7986 test_proc = proc { |shipment_class , test_shipment_class , dir , opts |
8087 test_shipment = test_shipment_class . new ( dir , "BC T bitonal 1 T contone 2" )
8188 shipment = shipment_class . new ( test_shipment . directory )
82- stage = Preflight . new ( shipment , config : opts . merge ( @config ) )
89+ stage = CreateSourceDirectory . new ( shipment , config : opts . merge ( @config ) )
8390 stage . run!
8491 tiff = File . join ( shipment . objid_to_path ( shipment . objids [ 0 ] ) ,
8592 "00000001.tif" )
@@ -105,7 +112,7 @@ def self.gen_feed_validate_crash
105112 ENV [ "FAKE_FEED_VALIDATE_CRASH" ] = "1"
106113 test_shipment = test_shipment_class . new ( dir , "BC T bitonal 1 T contone 2" )
107114 shipment = shipment_class . new ( test_shipment . directory )
108- stage = Preflight . new ( shipment , config : opts . merge ( @config ) )
115+ stage = CreateSourceDirectory . new ( shipment , config : opts . merge ( @config ) )
109116 stage . run!
110117 stage = Postflight . new ( shipment , config : opts . merge ( @config ) )
111118 stage . run!
@@ -120,7 +127,7 @@ def self.gen_checksum_mismatch
120127 test_proc = proc { |shipment_class , test_shipment_class , dir , opts |
121128 test_shipment = test_shipment_class . new ( dir , "BC T bitonal 1 T contone 2" )
122129 shipment = shipment_class . new ( test_shipment . directory )
123- stage = Preflight . new ( shipment , config : opts . merge ( @config ) )
130+ stage = CreateSourceDirectory . new ( shipment , config : opts . merge ( @config ) )
124131 stage . run!
125132 tiff = File . join ( shipment . source_directory ,
126133 shipment . objid_to_path ( shipment . objids [ 0 ] ) ,
@@ -138,7 +145,7 @@ def self.gen_file_missing
138145 test_proc = proc { |shipment_class , test_shipment_class , dir , opts |
139146 test_shipment = test_shipment_class . new ( dir , "BC T bitonal 1 T contone 2" )
140147 shipment = shipment_class . new ( test_shipment . directory )
141- stage = Preflight . new ( shipment , config : opts . merge ( @config ) )
148+ stage = CreateSourceDirectory . new ( shipment , config : opts . merge ( @config ) )
142149 stage . run!
143150 tiff = File . join ( shipment . source_directory ,
144151 shipment . objid_to_path ( shipment . objids [ 0 ] ) ,
@@ -156,7 +163,7 @@ def self.gen_file_added
156163 test_proc = proc { |shipment_class , test_shipment_class , dir , opts |
157164 test_shipment = test_shipment_class . new ( dir , "BC T bitonal 1 T contone 2" )
158165 shipment = shipment_class . new ( test_shipment . directory )
159- stage = Preflight . new ( shipment , config : opts . merge ( @config ) )
166+ stage = CreateSourceDirectory . new ( shipment , config : opts . merge ( @config ) )
160167 stage . run!
161168 tiff = File . join ( shipment . source_directory ,
162169 shipment . objid_to_path ( shipment . objids [ 0 ] ) ,
0 commit comments