guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Maxime Devos
Subject: [bug#54796] [PATCH v3 01/22] import: Add hex.pm importer.
Date: Sat, 09 Apr 2022 14:07:23 +0200
User-agent: Evolution 3.38.3-1

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.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]