testutil

package
v0.1.32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttemptCreateDerivedContent

func AttemptCreateDerivedContent(t *testing.T, serverURL, parentID string) *http.Response

AttemptCreateDerivedContent attempts to create a derived content and returns the response

func SetContentMetadata

func SetContentMetadata(t *testing.T, serverURL, contentID string, metadata map[string]interface{})

SetContentMetadata sets metadata for a content via the API

func SetupTestServer

func SetupTestServer() *httptest.Server

SetupTestServer creates a test server with all routes configured

Types

type ContentMetadataResponse

type ContentMetadataResponse struct {
	ContentID   string                 `json:"content_id"`
	ContentType string                 `json:"content_type"`
	Title       string                 `json:"title,omitempty"`
	Description string                 `json:"description,omitempty"`
	Tags        []string               `json:"tags,omitempty"`
	FileSize    int64                  `json:"file_size,omitempty"`
	CreatedBy   string                 `json:"created_by,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

ContentMetadataResponse represents the response from metadata-related API endpoints

func GetContentMetadata

func GetContentMetadata(t *testing.T, serverURL, contentID string) ContentMetadataResponse

GetContentMetadata gets metadata for a content via the API

type ContentResponse

type ContentResponse struct {
	ID              string `json:"id"`
	ParentID        string `json:"parent_id,omitempty"`
	OwnerID         string `json:"owner_id"`
	TenantID        string `json:"tenant_id"`
	Status          string `json:"status"`
	DerivationType  string `json:"derivation_type"`
	DerivationLevel int    `json:"derivation_level"`
}

ContentResponse represents the response from content-related API endpoints

func CreateContent

func CreateContent(t *testing.T, serverURL string) ContentResponse

CreateContent creates a new content via the API

func CreateDerivedContent

func CreateDerivedContent(t *testing.T, serverURL, parentID string) ContentResponse

CreateDerivedContent creates a derived content via the API

func GetDerivedContent

func GetDerivedContent(t *testing.T, serverURL, parentID string) []ContentResponse

GetDerivedContent gets derived content via the API

func GetDerivedContentTree

func GetDerivedContentTree(t *testing.T, serverURL, rootID string) []ContentResponse

GetDerivedContentTree gets the derived content tree via the API

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL