16561: Handle implicit port number in ws:// and wss:// urls.
[arvados.git] / lib / selfsigned / cert_test.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 package selfsigned
6
7 import (
8         "testing"
9 )
10
11 func TestCert(t *testing.T) {
12         cert, err := CertGenerator{Bits: 1024, Hosts: []string{"localhost"}, IsCA: false}.Generate()
13         if err != nil {
14                 t.Error(err)
15         }
16         if len(cert.Certificate) < 1 {
17                 t.Error("no certificate!")
18         }
19         cert, err = CertGenerator{Bits: 2048, Hosts: []string{"localhost"}, IsCA: true}.Generate()
20         if err != nil {
21                 t.Error(err)
22         }
23         if len(cert.Certificate) < 1 {
24                 t.Error("no certificate!")
25         }
26 }