Skip to content

Commit 16b4911

Browse files
Update tests
1 parent fb703f9 commit 16b4911

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

.github/workflows/test-elixir.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on: push
33
jobs:
44
test_elixir:
55
runs-on: ubuntu-latest
6-
name: Validate proxy-config.yml
6+
name: Validation bnlc-.csv
77
steps:
88
- uses: actions/checkout@v6
99
- uses: erlef/setup-beam@v1

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
jobs:
77
test:
88
runs-on: ubuntu-latest
9+
name: Validation datasets.csv
910
steps:
1011
- uses: actions/checkout@v6
1112
- uses: actions/setup-python@v6

test.exs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
Mix.install([{:csv, "~> 3.2"}])
1+
Mix.install([
2+
{:csv, "~> 3.2"},
3+
{:httpoison, "~> 2.0"},
4+
{:jason, "~> 1.4"}
5+
])
26

37
require Logger
48

@@ -7,4 +11,14 @@ File.stream!("bnlc-.csv")
711
|> Enum.to_list()
812
|> to_string()
913

10-
Logger.info("File is okay")
14+
Logger.info("Can decode the file")
15+
16+
github_url = "https://raw.githubusercontent.com/etalab/transport-base-nationale-covoiturage/refs/heads/main/bnlc-.csv"
17+
schema_url = "https://schema.data.gouv.fr/schemas/etalab/schema-lieux-covoiturage/latest/schema.json"
18+
19+
%{"report" => %{"valid" => true}} = return =
20+
HTTPoison.get!("https://api.validata.etalab.studio/validate?url=#{github_url}&schema=#{schema_url}")
21+
|> Map.fetch!(:body)
22+
|> Jason.decode!()
23+
Logger.debug(return)
24+
Logger.info("File is valid")

0 commit comments

Comments
 (0)