mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-21 06:45:26 -06:00
teach ntfy webpush to write the keys to a file
This commit is contained in:
parent
9d3fc20e58
commit
49a548252c
3 changed files with 30 additions and 1 deletions
|
|
@ -14,6 +14,13 @@ func TestCLI_WebPush_GenerateKeys(t *testing.T) {
|
|||
require.Contains(t, stderr.String(), "Web Push keys generated.")
|
||||
}
|
||||
|
||||
func TestCLI_WebPush_WriteKeysToFile(t *testing.T) {
|
||||
app, _, _, stderr := newTestApp()
|
||||
require.Nil(t, runWebPushCommand(app, server.NewConfig(), "keys", "--key-file=key-file.yaml"))
|
||||
require.Contains(t, stderr.String(), "Web Push keys written to key-file.yaml")
|
||||
require.FileExists(t, "key-file.yaml")
|
||||
}
|
||||
|
||||
func runWebPushCommand(app *cli.App, conf *server.Config, args ...string) error {
|
||||
webPushArgs := []string{
|
||||
"ntfy",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue