summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-environment.sh4
-rw-r--r--tests/profiles.scm10
-rw-r--r--tests/publish.scm12
-rw-r--r--tests/pypi.scm16
4 files changed, 40 insertions, 2 deletions
diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh
index 0b5123ab45..68343520b0 100644
--- a/tests/guix-environment.sh
+++ b/tests/guix-environment.sh
@@ -57,6 +57,10 @@ else
     test $? = 42
 fi
 
+# Make sure 'GUIX_ENVIRONMENT' points to the profile.
+guix environment --bootstrap --ad-hoc guile-bootstrap --pure \
+     -- "$SHELL" -c 'test -f "$GUIX_ENVIRONMENT/bin/guile"'
+
 case "`uname -m`" in
     x86_64)
 	# On x86_64, we should be able to create a 32-bit environment.
diff --git a/tests/profiles.scm b/tests/profiles.scm
index fc1dfd2bfc..028d7b6fb4 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -207,6 +207,16 @@
                                        #:hooks '())))
     (return (derivation-inputs drv))))
 
+(test-assert "package->manifest-entry defaults to \"out\""
+  (let ((outputs (package-outputs packages:glibc)))
+    (equal? (manifest-entry-output
+             (package->manifest-entry (package
+                                        (inherit packages:glibc)
+                                        (outputs (reverse outputs)))))
+            (manifest-entry-output
+             (package->manifest-entry packages:glibc))
+            "out")))
+
 (test-assertm "profile-manifest, search-paths"
   (mlet* %store-monad
       ((guile ->   (package
diff --git a/tests/publish.scm b/tests/publish.scm
index 0ba33487bd..4dc807505c 100644
--- a/tests/publish.scm
+++ b/tests/publish.scm
@@ -58,8 +58,16 @@
     (lambda (response body) body)))
 
 (define (http-get-port uri)
-  (call-with-values (lambda () (http-get uri #:streaming? #t))
-    (lambda (response port) port)))
+  (let ((socket (open-socket-for-uri uri)))
+    ;; Make sure to use an unbuffered port so that we can then peek at the
+    ;; underlying file descriptor via 'call-with-gzip-input-port'.
+    (setvbuf socket _IONBF)
+    (call-with-values
+        (lambda ()
+          (http-get uri #:port socket #:streaming? #t))
+      (lambda (response port)
+        (setvbuf port _IONBF)
+        port))))
 
 (define (publish-uri route)
   (string-append "http://localhost:6789" route))
diff --git a/tests/pypi.scm b/tests/pypi.scm
index 379c288394..01d8a575ab 100644
--- a/tests/pypi.scm
+++ b/tests/pypi.scm
@@ -73,6 +73,22 @@ baz > 13.37")
 
 (test-begin "pypi")
 
+(test-equal "guix-package->pypi-name, old URL style"
+  "psutil"
+  (guix-package->pypi-name
+   (dummy-package "foo"
+                  (source (dummy-origin
+                           (uri
+                            "https://pypi.io/packages/source/p/psutil/psutil-4.3.0.tar.gz"))))))
+
+(test-equal "guix-package->pypi-name, new URL style"
+  "certbot"
+  (guix-package->pypi-name
+   (dummy-package "foo"
+                  (source (dummy-origin
+                           (uri
+                            "https://pypi.python.org/packages/a2/3b/4756e6a0ceb14e084042a2a65c615d68d25621c6fd446d0fc10d14c4ce7d/certbot-0.8.1.tar.gz"))))))
+
 (test-assert "pypi->guix-package"
   ;; Replace network resources with sample data.
   (mock ((guix import utils) url-fetch