|
4 | 4 | cmr.system-int-test.search.collection-relevancy.collection-relevancy namespace.
|
5 | 5 | For all of the tests in this namespace we bin each integer value to its own bin."
|
6 | 6 | (:require
|
7 |
| - [clojure.string :as string] |
| 7 | + [clojure.string :as str] |
8 | 8 | [clojure.test :refer :all]
|
9 | 9 | [cmr.access-control.test.util :as u]
|
10 | 10 | [cmr.common.config :as config]
|
|
22 | 22 | [cmr.system-int-test.utils.search-util :as search]))
|
23 | 23 |
|
24 | 24 | (def sample-usage-csv
|
25 |
| - (string/join "\n" ["Product,Version,Hosts" |
26 |
| - "AMSR-L1A,3,10" |
27 |
| - "AG_VIRTUAL,1,100" |
28 |
| - "AG_MAPSS,2,30" |
29 |
| - "AST_05,B,8"])) |
| 25 | + (str "Product,Version,Hosts\n" |
| 26 | + "AMSR-L1A,3,10\n" |
| 27 | + "AG_VIRTUAL,1,100\n" |
| 28 | + "AG_MAPSS,2,30\n" |
| 29 | + "AST_05,B,8\n")) |
30 | 30 |
|
31 | 31 | (defn- init-community-usage-fixture
|
32 | 32 | "Sets up the community usage config required for each test."
|
|
234 | 234 | (let [results (:refs (search/find-refs :collection {:keyword "AMSR-L1A"}))]
|
235 | 235 | (is (= ["AMSR-L1A 003" "AMSR-L1A 2" "AMSR-L1A 1"]
|
236 | 236 | (map :name results)))))
|
237 |
| - |
238 |
| -(deftest sorting-handles-persistent-id-attribute-test |
239 |
| - (d/ingest-umm-spec-collection "PROV1" |
240 |
| - (data-umm-c/collection {:ShortName "ABOM-AUS-RAMSSA_09km" |
241 |
| - :EntryTitle "PODAAC 1" |
242 |
| - :AdditionalAttributes |
243 |
| - [{:Name "Persistent ID" |
244 |
| - :Value "PODAAC-GHRAM-4FA01" |
245 |
| - :DataType "STRING" |
246 |
| - :Description "Dataset Persistent ID"}] |
247 |
| - :Version "1"})) |
248 |
| - (d/ingest-umm-spec-collection "PROV1" |
249 |
| - (data-umm-c/collection {:ShortName "L4HRfnd-AUS-RAMSSA_09km" |
250 |
| - :EntryTitle "PODAAC 2" |
251 |
| - :AdditionalAttributes |
252 |
| - [{:Name "Persistent ID" |
253 |
| - :Value "PODAAC-HHRAD-5FB11" |
254 |
| - :DataType "STRING" |
255 |
| - :Description "Dataset Persistent ID"}] |
256 |
| - :Version "1"})) |
257 |
| - |
258 |
| - (index/wait-until-indexed) |
259 |
| - (hu/ingest-community-usage-metrics (str "Product,Version,Hosts\n" |
260 |
| - "PODAAC-GHRAM-4FA01,1,10\n" |
261 |
| - "PODAAC-HHRAD-5FB11,1,50\n")) |
262 |
| - (index/wait-until-indexed) |
263 |
| - (are3 |
264 |
| - [sort-order expected] |
265 |
| - (let [results (:refs (search/find-refs :collection {:keyword "PODAAC" :sort-key sort-order}))] |
266 |
| - (is (= expected |
267 |
| - (map :name results)))) |
268 |
| - |
269 |
| - "ascending usage" |
270 |
| - "usage-score" ["PODAAC 1" "PODAAC 2"] |
271 |
| - |
272 |
| - "descending usage" |
273 |
| - "-usage-score" ["PODAAC 2" "PODAAC 1"])) |
0 commit comments