open OUnit2
open ConfLoader

(** Test the dependencies extracted from the external named "source".

    Refer to the default configuration used in [ConfLoader] to see the
    configuration.
 *)
let test_get_dependencies_for_source =
  "get_dependancies_for_table" >:: fun _ ->
  let result = ImportConf.get_dependancies_for_table conf conf.source
  and expected = [ external_other ] in
  assert_equal ~printer:pp_externals expected result

let test_get_dependencies_for_other =
  "get_dependancies_for_table" >:: fun _ ->
  let result = ImportConf.get_dependancies_for_table conf external_table_other
  and expected = [ external_last ] in
  assert_equal ~printer:pp_externals expected result

let tests =
  "importConf_test"
  >::: [ test_get_dependencies_for_source; test_get_dependencies_for_other ]