Skip to content

Commit

Permalink
Adds more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Omondi committed May 16, 2024
1 parent 70206b5 commit 5a70115
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@ public async Task GeneratesManifest()
/test:
get:
description: description for test path
operationId: test
responses:
'200':
description: test
/test/{id}:
get:
description: description for test path with id
operationId: test_WithId
operationId: test.WithId
parameters:
- name: id
in: path
Expand Down Expand Up @@ -79,6 +78,7 @@ public async Task GeneratesManifest()
};
var (openAPIDocumentStream, _) = await openAPIDocumentDS.LoadStreamAsync(simpleDescriptionPath, generationConfiguration, null, false);
var openApiDocument = await openAPIDocumentDS.GetDocumentFromStreamAsync(openAPIDocumentStream, generationConfiguration);
KiotaBuilder.CleanupOperationIdForPlugins(openApiDocument);
var urlTreeNode = OpenApiUrlTreeNode.Create(openApiDocument, Constants.DefaultOpenApiLabel);

var pluginsGenerationService = new PluginsGenerationService(openApiDocument, urlTreeNode, generationConfiguration, workingDirectory);
Expand All @@ -95,7 +95,8 @@ public async Task GeneratesManifest()
var resultingManifest = PluginManifestDocument.Load(jsonDocument.RootElement);
Assert.NotNull(resultingManifest.Document);
Assert.Equal(OpenApiFileName, resultingManifest.Document.Runtimes.OfType<OpenApiRuntime>().First().Spec.Url);
Assert.Empty(resultingManifest.Problems);
Assert.Equal(2, resultingManifest.Document.Functions.Count);// all functions are generated despite missing operationIds
Assert.Empty(resultingManifest.Problems);// no problems are expected with names

// Validate the v1 plugin
var v1ManifestContent = await File.ReadAllTextAsync(Path.Combine(outputDirectory, OpenAIPluginFileName));
Expand Down

0 comments on commit 5a70115

Please sign in to comment.