Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FormRecognizer] Enabling tests after service-side fixes #14266

Merged
merged 3 commits into from
Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ public async Task StartRecognizeCustomFormsThrowsForDamagedFile(bool useTraining
/// Recognizer cognitive service and handle returned errors.
/// </summary>
[Test]
[TestCase(true, Ignore = "https://github.com/Azure/azure-sdk-for-net/issues/12319")]
[TestCase(true)]
[TestCase(false)]
public async Task StartRecognizeCustomFormsFromUriThrowsForNonExistingContent(bool useTrainingLabels)
{
Expand All @@ -1209,9 +1209,8 @@ public async Task StartRecognizeCustomFormsFromUriThrowsForNonExistingContent(bo
var operation = await client.StartRecognizeCustomFormsFromUriAsync(trainedModel.ModelId, invalidUri);

RequestFailedException ex = Assert.ThrowsAsync<RequestFailedException>(async () => await operation.WaitForCompletionAsync(PollingInterval));
string expectedErrorCode = useTrainingLabels ? "3003" : "2003";
Assert.AreEqual(expectedErrorCode, ex.ErrorCode);

Assert.AreEqual("2003", ex.ErrorCode);
Assert.True(operation.HasCompleted);
Assert.False(operation.HasValue);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ public async Task CopyModel()
}

[Test]
[Ignore("Issue: https://github.com/Azure/azure-sdk-for-net/issues/12319")]
public void CopyModelError()
{
var sourceClient = CreateFormTrainingClient();
Expand All @@ -256,7 +255,10 @@ public void CopyModelError()

CopyAuthorization targetAuth = CopyAuthorization.FromJson("{\"modelId\":\"328c3b7d - a563 - 4ba2 - 8c2f - 2f26d664486a\",\"accessToken\":\"5b5685e4 - 2f24 - 4423 - ab18 - 000000000000\",\"expirationDateTimeTicks\":1591932653,\"resourceId\":\"resourceId\",\"resourceRegion\":\"westcentralus\"}");

Assert.ThrowsAsync<RequestFailedException>(async () => await sourceClient.StartCopyModelAsync("00000000-0000-0000-0000-000000000000", targetAuth));
RequestFailedException ex = Assert.ThrowsAsync<RequestFailedException>(async () => await sourceClient.StartCopyModelAsync("00000000-0000-0000-0000-000000000000", targetAuth));

Assert.AreEqual(400, ex.Status);
Assert.AreEqual("1002", ex.ErrorCode);
}

[Test]
Expand Down
Loading