# Copyright (C) 2023 University College London
# Licensed under GNU GPL Version 3 <https://www.gnu.org/licenses/gpl-3.0.html>

test_that("generate_null_distribution returns vector of correct length", {
              skip_if_no_dawnn_deps()

              out <- sep_r(function() {
                        reticulate::use_condaenv("tf_env")
                        cells <- readRDS("../data/dawnn_test_data_1200_cells_discrete_clusters_1gene_2pc.rds")
                        set.seed(123)
                        cells <- Seurat::FindNeighbors(cells, reduction = "pca",
                                                       k.param = 1001, dims = 1:2,
                                                       return.neighbor = TRUE)
                        model_file <- dawnn:::dawnn_default_model_file()
                        model <- dawnn:::load_model_from_python(model_file)
                        out <- suppressMessages(dawnn:::generate_null_dist(cells, model,
                                                                          label_names = "label",
                                                                          label_pos_lfc = "Condition1",
                                                                          verbosity = 1,
                                                                          da_mode = "lda"))
                })
              expect_vector(out, ptype = double(), size = 3600)
})
