tier3: contracts + tests for 12 remaining modules (all 39 files now have Contracts)
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 3s
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 3s
This commit is contained in:
@@ -17,6 +17,17 @@ The gateway management functions (~messaging-link~, ~messaging-unlink~, ~messagi
|
||||
|
||||
This replaces the old ~gateway-manager~ skill. The Telegram/Signal platform code is unchanged; only the management entry points and the defskill name changed.
|
||||
|
||||
** Contract
|
||||
|
||||
1. (gateway-registry-initialize): populates ~*gateway-registry*~ with
|
||||
~:configured~ status per platform based on env vars.
|
||||
2. (messaging-link platform &key token): stores the token in the vault
|
||||
and starts the gateway's polling thread.
|
||||
3. (messaging-unlink platform): removes the token and stops the thread.
|
||||
4. (gateway-configured-p platform): returns T if platform is configured.
|
||||
5. (gateway-start platform): starts the background poll thread for a
|
||||
named gateway platform.
|
||||
|
||||
* Implementation
|
||||
|
||||
** Data
|
||||
@@ -262,3 +273,28 @@ This replaces the old ~gateway-manager~ skill. The Telegram/Signal platform code
|
||||
(gateway-registry-initialize)
|
||||
(gateway-start-all)
|
||||
#+end_src
|
||||
|
||||
#+end_src
|
||||
|
||||
* Test Suite
|
||||
|
||||
#+begin_src lisp
|
||||
(eval-when (:compile-toplevel :load-toplevel :execute)
|
||||
(ql:quickload :fiveam :silent t))
|
||||
|
||||
(defpackage :passepartout-gateway-messaging-tests
|
||||
(:use :cl :fiveam :passepartout)
|
||||
(:export #:messaging-suite))
|
||||
|
||||
(in-package :passepartout-gateway-messaging-tests)
|
||||
|
||||
(def-suite messaging-suite :description "Verification of Gateway Messaging")
|
||||
(in-suite messaging-suite)
|
||||
|
||||
(test test-gateway-registry-initialize
|
||||
"Contract 1: gateway-registry-initialize populates the registry."
|
||||
(clrhash passepartout::*gateway-registry*)
|
||||
(gateway-registry-initialize)
|
||||
(is (not (zerop (hash-table-count passepartout::*gateway-registry*))))
|
||||
(is (getf (gethash "telegram" passepartout::*gateway-registry*) :configured)))
|
||||
#+end_src
|
||||
|
||||
Reference in New Issue
Block a user