github.com/readium/readium-lcp-server@v0.0.0-20240101192032-6e95190e99f1/license/license_test.go (about)

     1  // Copyright 2020 Readium Foundation. All rights reserved.
     2  // Use of this source code is governed by a BSD-style license
     3  // that can be found in the LICENSE file exposed on Github (readium) in the project repository.
     4  
     5  package license
     6  
     7  import (
     8  	"testing"
     9  
    10  	"github.com/readium/readium-lcp-server/config"
    11  )
    12  
    13  func TestLicense(t *testing.T) {
    14  	config.Config.Profile = "1.0"
    15  
    16  	l := License{}
    17  	contentID := "1234-1234-1234-1234"
    18  	Initialize(contentID, &l)
    19  	if l.ID == "" {
    20  		t.Error("Should have an id")
    21  	}
    22  
    23  	err := SetLicenseProfile(&l)
    24  	if err != nil {
    25  		t.Error(err.Error())
    26  	}
    27  }