Subject: [bug#54796] [PATCH v3 01/22] import: Add hex.pm importer.

From: Maxime Devos <[email-masked]>
Date: Sat, 09 Apr 2022 14:07:23 +0200

Hartmut Goebel schreef op vr 08-04-2022 om 19:03 [+0200]:
> +(test-assert "hexpm->guix-package"
> +  ;; Replace network resources with sample data.
> +  (mock ((guix http-client) http-fetch
> +         (lambda (url . rest)
> +           (match url
> +             ("https://hex.pm/api/packages/bla"
> +              (values (open-input-string test-bla-package)
> +                      (string-length test-bla-package)))
> +             ("https://hex.pm/api/packages/bla/releases/1.5.0"
> +              (values (open-input-string test-bla-release)
> +                      (string-length test-bla-release)))
> +             (_ (error "http-fetch got unexpected URL: " url)))))

From what I've gathered, with-http-server and the like is preferred
above mocking, though with-http-server might need to be extended first
to allow checking the URL (see <https://issues.guix.gnu.org/53389>).

Greetings,
Maxime.