<commit_before>(ns busa-server.api.connection-api-test
  (:require
    [midje.sweet :refer :all]
    [ring.mock.request :as mock]
    [busa-server.api.handler :as handler]
    [busa-server.core.connections :as connections]))

(fact "should find connection departuring next by departure and arrival place"
  (handler/busa-handler
    (mock/request :get "/api/connections/departuring_next?departure=nummela&arrival=helsinki")) => (contains {:body {:id "foo"}})
    (provided
      (connections/find-connection-departuring-next "nummela" "helsinki") => {:id "foo"}))
<commit_msg>test(api.connection-api-test): improve checking of test<commit_after>(ns busa-server.api.connection-api-test
  (:require
    [midje.sweet :refer :all]
    [ring.mock.request :as mock]
    [busa-server.api.handler :as handler]
    [busa-server.core.connections :as connections]))

(fact "should find connection departuring next by departure and arrival place"
  (handler/busa-handler
    (mock/request :get "/api/connections/departuring_next?departure=nummela&arrival=helsinki")) => (contains {:body {:id "foo"} :status 200})
    (provided
      (connections/find-connection-departuring-next "nummela" "helsinki") => {:id "foo"}))

{'fraction_non_alphanumeric': 0.15008291873963517, 'fraction_numerical': 0.0024875621890547263, 'mean_word_length': 4.693396226415095, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1664', 'n_tokens_mistral': 416, 'n_tokens_neox': 390, 'n_words': 86}