                                      (:output t :occur 1)
                                      (:output nil :occur 1)))
                  (configuration-layer/layer-usedp (l) ((:output t :occur 2))))
-                (should (equal '([object cfgl-package "pkg3" pkg3 layer10 nil nil elpa nil nil]
-                                 [object cfgl-package "pkg2" pkg2 layer9 nil nil elpa nil t]
-                                 [object cfgl-package "pkg1" pkg1 layer9 nil nil elpa nil nil])
+                (should (equal (list (cfgl-package "pkg3" :name 'pkg3 :owner 'layer10)
+                                     (cfgl-package "pkg2" :name 'pkg2 :owner 'layer9 :excluded t)
+                                     (cfgl-package "pkg1" :name 'pkg1 :owner 'layer9))
                                (configuration-layer/get-packages layers))))))
 
 (ert-deftest test-get-packages--dotfile-excludes-pkg2-in-layer-11 ()

                ,(configuration-layer/make-package 'pkg6)
                ,(configuration-layer/make-package 'pkg2)
                ,(configuration-layer/make-package 'pkg1))))
    (should (equal '([object cfgl-package "pkg1" pkg1 nil nil nil elpa nil nil]
                     [object cfgl-package "pkg2" pkg2 nil nil nil elpa nil nil]
                     [object cfgl-package "pkg3" pkg3 nil nil nil elpa nil nil]
                     [object cfgl-package "pkg4" pkg4 nil nil nil elpa nil nil]
                     [object cfgl-package "pkg6" pkg6 nil nil nil elpa nil nil])
                   (configuration-layer//sort-packages pkgs)))))

;; ---------------------------------------------------------------------------
;; configuration-layer/filter-packages
;; ---------------------------------------------------------------------------

(ert-deftest test-filter-packages--filter-excluded-packages ()
  (let* ((pkg1 (configuration-layer/make-package 'pkg1))
         (pkg2 (configuration-layer/make-package 'pkg2))
         (pkg3 (configuration-layer/make-package 'pkg3))

    (mocker-let ((file-exists-p (f) ((:output t :occur 1)
                                     (:output nil :occur 1)))
                 (configuration-layer/layer-usedp (l) ((:output t :occur 1))))
                (should (equal (list (cfgl-package "pkg3" :name 'pkg3 :owner 'layer2)
                                     (cfgl-package "pkg2" :name 'pkg2)
                                     (cfgl-package "pkg1" :name 'pkg1 :owner 'layer2))
                               (configuration-layer/get-packages layers))))))

(ert-deftest test-get-packages--pre-init-function ()
