Feat/error logs (#16)

* added list of tasks to achieve

* update deps

* update elixir version in CI/CD pipeline

* update todo with branch push checks

* underscores separation of large numbers

* update elixir version and deps

* add basic module  docs

* remove IO.inspect call

* check if list is empty rather than traversing list for length

* revert empty list code

* duration tests

* add mime type tests

* use logger instread of inspect, remove todos

* replace list length check with Enum.empty

* replace list length check with !Enum.empty?

* numbers readability fix by using underscores on large numbers

* iucn parser replaced case with multiclause function and added test

* replace map and join with map_join

* fix multiple spec issues where map() must be inside a list
This commit is contained in:
2025-12-06 23:41:59 +01:00
committed by GitHub
parent 3d3059e77f
commit 02372f2076
27 changed files with 241 additions and 45 deletions
+15
View File
@@ -63,4 +63,19 @@ defmodule PlantIdDiscordBotTest.PlantNet.Parser do
"My best guess is **Prunus cerasifera** with a confidence of **88%**.\n\nSpecies info from plant databases:\n[GBIF](<https://www.gbif.org/species/3021730>) | [PFAF](<https://pfaf.org/user/Plant.aspx?LatinName=/Prunus+cerasifera>) | [POWO](<https://powo.science.kew.org/taxon/729568-1>)\n\nConservation status: Data Deficient\n\nAlternatives include **Prunus × cistena**."
end
end
describe "iucn_parser/1" do
test "return correct string for abbreviation" do
assert Parser.iucn_parser("DD") == "Data Deficient"
assert Parser.iucn_parser("LC") == "Least Concern"
assert Parser.iucn_parser("NT") == "Near Threatened"
assert Parser.iucn_parser("VU") == "Vulnerable"
assert Parser.iucn_parser("EN") == "Endangered"
assert Parser.iucn_parser("CR") == "Critically Endangered"
assert Parser.iucn_parser("EW") == "Extinct in the Wild"
assert Parser.iucn_parser("EX") == "Extinct"
assert Parser.iucn_parser("NE") == "Not Evaluated"
assert Parser.iucn_parser("ABC") == "Unknown"
end
end
end