-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use AVPRIndex BinaryContent functions in AVPRClient extensions
- Loading branch information
Showing
5 changed files
with
46 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,20 +73,9 @@ module ValidationPackageMetadata = | |
CQCHookEndpoint = "hookendpoint" | ||
) | ||
|
||
module PackageContentHash = | ||
open System | ||
open System.IO | ||
open System.Text | ||
open System.Security.Cryptography | ||
|
||
let expected_hash = | ||
let md5 = MD5.Create() | ||
"fixtures/test_validation_package_all_fields.fsx" | ||
|> File.ReadAllText | ||
|> fun s -> s.ReplaceLineEndings("\n") | ||
|> Encoding.UTF8.GetBytes | ||
|> md5.ComputeHash | ||
|> Convert.ToHexString | ||
module Hash = | ||
|
||
let expected_hash = "C5BD4262301D27CF667106D9024BD721" | ||
|
||
let allFields = AVPRClient.PackageContentHash( | ||
PackageName = "name", | ||
|
@@ -95,17 +84,42 @@ module PackageContentHash = | |
PackagePatchVersion = 0, | ||
Hash = expected_hash | ||
) | ||
|
||
|
||
module ValidationPackage = | ||
module BinaryContent = | ||
|
||
open System.IO | ||
|
||
let expected_content = | ||
let expected_content = "(* | ||
--- | ||
Name: name | ||
Summary: summary | ||
Description = description | ||
MajorVersion: 1 | ||
MinorVersion: 0 | ||
PatchVersion: 0 | ||
Publish: true | ||
Authors: | ||
- FullName: test | ||
Email: [email protected] | ||
Affiliation: testaffiliation | ||
AffiliationLink: test.com | ||
Tags: | ||
- Name: test | ||
TermSourceREF: REF | ||
TermAccessionNumber: TAN | ||
ReleaseNotes: releasenotes | ||
CQCHookEndpoint: hookendpoint | ||
--- | ||
*) | ||
printfn \"yes\"" .ReplaceLineEndings("\n") | ||
|
||
let expected_binary_content = expected_content |> System.Text.Encoding.UTF8.GetBytes | ||
|
||
"fixtures/test_validation_package_all_fields.fsx" | ||
|> File.ReadAllBytes | ||
|
||
module ValidationPackage = | ||
|
||
open System.IO | ||
|
||
let allFields = AVPRClient.ValidationPackage( | ||
Name = "name", | ||
|
@@ -114,7 +128,7 @@ module ValidationPackage = | |
MajorVersion = 1, | ||
MinorVersion = 0, | ||
PatchVersion = 0, | ||
PackageContent = expected_content, | ||
PackageContent = BinaryContent.expected_binary_content, | ||
ReleaseDate = date, | ||
Authors = [|Author.allFieldsClient|], | ||
Tags = [|OntologyAnnotation.allFieldsClient|], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters