@@ -8,6 +8,7 @@ const PRG: &str = "dcp";
8
8
const TEST_CONTENT_DIR : & str = "/tmp/dcp_test_run" ;
9
9
const DEFAULT_IMAGE : & str = "quay.io/tyslaton/sample-catalog:v0.0.4" ;
10
10
const IMAGE_NO_TAG : & str = "quay.io/tyslaton/sample-catalog" ;
11
+ const SCRATCH_BASE_IMAGE : & str = "quay.io/tflannag/bundles:resolveset-v0.0.2" ;
11
12
12
13
// generate_temp_path takes the constant TEST_CONTENT_DIR and
13
14
// returns a new string with an appended 5 digit string
@@ -71,6 +72,24 @@ fn accepts_content_path() -> TestResult {
71
72
Ok ( ( ) )
72
73
}
73
74
75
+ // --------------------------------------------------
76
+ #[ test]
77
+ fn fails_invalid_content_path ( ) -> TestResult {
78
+ let path = & generate_temp_path ( ) ;
79
+ let content_path = "manifests" ;
80
+
81
+ // --content-path has been specified but fails as
82
+ // there's no "manifests" directory in the
83
+ // DEFAULT_IMAGE container image.
84
+ Command :: cargo_bin ( PRG ) ?
85
+ . args ( & [ "--download-path" , path] )
86
+ . args ( & [ "--content-path" , content_path, DEFAULT_IMAGE ] )
87
+ . assert ( )
88
+ . failure ( ) ;
89
+
90
+ Ok ( ( ) )
91
+ }
92
+
74
93
// --------------------------------------------------
75
94
#[ test]
76
95
fn accepts_image ( ) -> TestResult {
@@ -121,3 +140,17 @@ fn fails_on_just_tag() -> TestResult {
121
140
122
141
Ok ( ( ) )
123
142
}
143
+
144
+ // --------------------------------------------------
145
+ #[ test]
146
+ fn accepts_scratch_base_images ( ) -> TestResult {
147
+ let content_path: & str = "manifests" ;
148
+
149
+ Command :: cargo_bin ( PRG ) ?
150
+ . args ( & [ "--content-path" , content_path] )
151
+ . args ( & [ SCRATCH_BASE_IMAGE ] )
152
+ . assert ( )
153
+ . success ( ) ;
154
+
155
+ Ok ( ( ) )
156
+ }
0 commit comments