Exemplo n.º 1
0
        public async Task MlProcessing_ModelTraining_AllGenericFilesProcessed()
        {
            var models = Harness.GetDependentFilesExcept(FolderId, FileType.Image, FileType.Tabular, FileType.Pdf);

            foreach (var modelId in models)
            {
                var model = await Session.Get <Model>(modelId);

                model.Should().NotBeNull();
                model.Status.Should().Be(ModelStatus.Processed);

                await JohnApi.SetPublicModelsEntity(modelId, true);

                Harness.WaitWhileModelShared(modelId);

                var responseSSP = await JohnApi.CreateSingleStructurePridiction(new RunSingleStructurePrediction
                {
                    Format   = "SMILES",
                    ModelIds = new List <Guid> {
                        modelId
                    },
                    PropertyName = "name",
                    Structure    = "C1C=CC=C1C1C=CC=C1"
                });

                var predictionId = JToken.Parse(await responseSSP.Content.ReadAsStringAsync())["predictionId"].ToObject <Guid>();
                responseSSP.EnsureSuccessStatusCode();

                var responseStatus = await JohnApi.GetPredictionStatus(predictionId);

                var status = JToken.Parse(await responseStatus.Content.ReadAsStringAsync());
                status["id"].ToObject <Guid>().ShouldBeEquivalentTo(predictionId);
//                status["status"].ToObject<string>().ShouldAllBeEquivalentTo("CALCULATING");
            }

            await Task.CompletedTask;
        }