<commit_before>(ns pundit.test.helper
  (import (clojure.lang ExceptionInfo))
  (require [clojure.test :refer :all]
           [pundit.api :as pa]
           [pundit.comparisons :refer :all]))

; Private stuff

(def ^:private props
  (into {} (doto (java.util.Properties.)
             (.load (-> (Thread/currentThread)
                        .getContextClassLoader
                        (.getResourceAsStream "test.properties"))))))

(def ^:private auth
  [(props "parse.app") (props "parse.key")])

; Shorthand class names

(def Foo "PunditFoo")

(def Bar "PunditBar")
<commit_msg>Better error message for missing properties file<commit_after>(ns pundit.test.helper
  (import (clojure.lang ExceptionInfo))
  (require [clojure.test :refer :all]
           [pundit.api :as pa]
           [pundit.comparisons :refer :all]))

; Private stuff

(def ^:private props
  (if-let [props (-> (Thread/currentThread)
                   .getContextClassLoader
                   (.getResourceAsStream "test.properties"))]
    (into {} (doto (java.util.Properties.) (.load props)))
    (throw (Exception. "Properties file not found, see README"))))

(def ^:private auth
  [(props "parse.app") (props "parse.key")])

; Shorthand class names

(def Foo "PunditFoo")

(def Bar "PunditBar")

{'fraction_non_alphanumeric': 0.14498432601880878, 'fraction_numerical': 0.0, 'mean_word_length': 2.8814589665653494, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1434736', 'n_tokens_mistral': 418, 'n_tokens_neox': 410, 'n_words': 105}