OCaml library and CLI for OCI and Docker image manipulation
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

oci: rename test_ functions in interop test (merlint E330)

+20 -18
+20 -18
test/interop/registry/test.ml
··· 6 6 open Alcotest 7 7 open Oci_spec 8 8 9 + let case = test_case 10 + 9 11 let trace path = Filename.concat "traces" path 10 12 11 13 let read_file path = ··· 30 32 31 33 (* {1 Index parsing} *) 32 34 33 - let test_parse_index () = 35 + let parse_index () = 34 36 let raw = read_file "index.json" in 35 37 match Manifest.of_string raw with 36 38 | Error (`Msg e) -> fail e ··· 51 53 check bool "has linux/amd64" true has_amd64 52 54 | Ok _ -> fail "expected OCI index" 53 55 54 - let test_index_annotations () = 56 + let index_annotations () = 55 57 let raw = read_file "index.json" in 56 58 match Manifest.of_string raw with 57 59 | Error (`Msg e) -> fail e ··· 66 68 check bool "has version annotation" true has_version 67 69 | Ok _ -> fail "expected OCI index" 68 70 69 - let test_index_digest () = 71 + let index_digest () = 70 72 let expected, _, _ = meta () in 71 73 match Digest.of_string expected with 72 74 | Ok d -> ··· 78 80 79 81 (* {1 Manifest parsing} *) 80 82 81 - let test_parse_manifest () = 83 + let parse_manifest () = 82 84 let raw = read_file "manifest.json" in 83 85 match Manifest.of_string raw with 84 86 | Error (`Msg e) -> fail e ··· 100 102 (Media_type.to_string config_mt) 101 103 | Ok _ -> fail "expected single-platform manifest" 102 104 103 - let test_manifest_config_digest () = 105 + let manifest_config_digest () = 104 106 let _, _, expected = meta () in 105 107 let raw = read_file "manifest.json" in 106 108 match Manifest.of_string raw with ··· 115 117 116 118 (* {1 Config parsing} *) 117 119 118 - let test_parse_config () = 120 + let parse_config () = 119 121 let raw = read_file "config.json" in 120 122 match Config.OCI.of_string raw with 121 123 | Error (`Msg e) -> fail e ··· 126 128 127 129 (* {1 Round-trip} *) 128 130 129 - let test_index_roundtrip () = 131 + let index_roundtrip () = 130 132 let raw = read_file "index.json" in 131 133 match Manifest.of_string raw with 132 134 | Error (`Msg e) -> fail e ··· 141 143 | Ok _ -> fail "round-trip changed manifest type") 142 144 | Ok _ -> fail "expected OCI index" 143 145 144 - let test_manifest_roundtrip () = 146 + let manifest_roundtrip () = 145 147 let raw = read_file "manifest.json" in 146 148 match Manifest.of_string raw with 147 149 | Error (`Msg e) -> fail e ··· 156 158 157 159 (* {1 Index.v constructor} *) 158 160 159 - let test_index_v () = 161 + let index_v () = 160 162 let desc = 161 163 Descriptor.v 162 164 ~platform:(Platform.v Arch.Amd64 OS.Linux) ··· 202 204 [ 203 205 ( "index", 204 206 [ 205 - test_case "parse" `Quick test_parse_index; 206 - test_case "annotations" `Quick test_index_annotations; 207 - test_case "digest" `Quick test_index_digest; 208 - test_case "roundtrip" `Quick test_index_roundtrip; 209 - test_case "Index.v constructor" `Quick test_index_v; 207 + case "parse" `Quick parse_index; 208 + case "annotations" `Quick index_annotations; 209 + case "digest" `Quick index_digest; 210 + case "roundtrip" `Quick index_roundtrip; 211 + case "Index.v constructor" `Quick index_v; 210 212 ] ); 211 213 ( "manifest", 212 214 [ 213 - test_case "parse" `Quick test_parse_manifest; 214 - test_case "config digest" `Quick test_manifest_config_digest; 215 - test_case "roundtrip" `Quick test_manifest_roundtrip; 215 + case "parse" `Quick parse_manifest; 216 + case "config digest" `Quick manifest_config_digest; 217 + case "roundtrip" `Quick manifest_roundtrip; 216 218 ] ); 217 - ("config", [ test_case "parse" `Quick test_parse_config ]); 219 + ("config", [ case "parse" `Quick parse_config ]); 218 220 ]