Documentation ¶
Index ¶
- Constants
- Variables
- func ChunkFileJSONL() io.ReadSeeker
- func DebugTempDir(t *testing.T) string
- func DummyChannel(id string) *slack.Channel
- func FilledBuffer(sz int) *bytes.Buffer
- func FilledFile(t *testing.T, sz int) *os.File
- func JoinPath(dir string, files ...string) []string
- func Load[T any](js string) T
- func LoadPtr[T any](js string) *T
- func MkTestFile(t *testing.T, dir string, content string) string
- func MkTestFileName(t *testing.T, path, content string) string
- func PrepareDir(t *testing.T, dir string, content string, files ...string)
- func RandString(sz int) string
- func SkipInCI(t *testing.T)
- func StripExt(filename string) string
- func TestAuthServer(t *testing.T) *httptest.Server
- func TestServer(t *testing.T, code int, response []byte) *httptest.Server
Constants ¶
const ( TestAppToken = "xoxa-888888888888-888888888888-8888888888888-fffffffffffffffa915fe069d70a8ad81743b0ec4ee9c81540af43f5e143264b" TestBotToken = "xoxb-888888888888-888888888888-8888888888888-fffffffffffffffa915fe069d70a8ad81743b0ec4ee9c81540af43f5e143264b" TestClientToken = "xoxc-888888888888-888888888888-8888888888888-fffffffffffffffa915fe069d70a8ad81743b0ec4ee9c81540af43f5e143264b" TestExportToken = "xoxe-888888888888-888888888888-8888888888888-fffffffffffffffa915fe069d70a8ad81743b0ec4ee9c81540af43f5e143264b" TestPersonalToken = "xoxp-777777777777-888888888888-8888888888888-fffffffffffffffa915fe069d70a8ad81743b0ec4ee9c81540af43f5e143264b" )
const ( SimpleMessageJSON = `` /* 778-byte string literal not displayed */ ThreadMessage1JSON = `` /* 4735-byte string literal not displayed */ ThreadedExportedMessage1JSON = `` /* 1626-byte string literal not displayed */ BotMessageThreadParentJSON = `` /* 3083-byte string literal not displayed */ BotMessageThreadChildJSON = `` /* 1873-byte string literal not displayed */ TestChannelEveryoneMessagesNativeExport = `` /* 5078-byte string literal not displayed */ AppMessageJSON = `` /* 776-byte string literal not displayed */ )
const ChunkFileChannelID = "CO73D19AAE17"
const (
ChunkWorkspace = `` /* 170-byte string literal not displayed */
)
const FileJPEG = `` /* 2925-byte string literal not displayed */
const TestChannels = `` /* 4042-byte string literal not displayed */
const TestChannelsNativeExport = `` /* 3371-byte string literal not displayed */
TestChannelsNativeExport are from the real Slack workspace export.
const TestConversationExportJSON = `` /* 11394-byte string literal not displayed */
const TestConversationJSON = `` /* 7842-byte string literal not displayed */
TestConversationJSON channel: CHM82GF99
const TestMessage = `` /* 522-byte string literal not displayed */
const UsersJSON = `` /* 11818-byte string literal not displayed */
Variables ¶
var ( //go:embed assets/export/dms.json TestExpDMsJSON []byte //go:embed assets/export/mpims.json TestExpMPIMsJSON []byte //go:embed assets/export/groups.json TestExpGroupsJSON []byte //go:embed assets/export/channels.json TestExpChannelsJSON []byte //go:embed assets/export/users.json TestExpUsersJSON []byte //go:embed assets/export/ref-channels.json TestExpReferenceChannelsJSON []byte )
Export fixtures.
var InCI = os.Getenv("CI") == "true"
InCI indicates whether the tests are running in CI.
var TestAuthTestInfo []byte
var TestExportFS embed.FS
var TestUsers = []slack.User{ {ID: "LOL1", Name: "yippi", Deleted: false}, {ID: "DELD", Name: "ka", Deleted: true}, {ID: "LOL3", Name: "yay", IsRestricted: true}, {ID: "LOL4", Name: "motherfucker", Deleted: false, IsBot: true}, }
var WorkspaceFiles = []string{"ora600.bin", "sdump.bin", "foo.bin", "bar.bin", "provider.bin", "default.bin"}
Functions ¶
func ChunkFileJSONL ¶
func ChunkFileJSONL() io.ReadSeeker
ChunkFileJSONL returns a reader for the chunks.jsonl.gz file.
func DebugTempDir ¶
DebugTempDir creates a temporary directory for debugging purposes. It does not get removed after the test.
func DummyChannel ¶
DummyChannel is the helper function that returns a pointer to a slack.Channel with the given ID, that could be used in tests.
func FilledBuffer ¶
FilledBuffer returns buffer that filled with sz bytes of 0x00.
func FilledFile ¶
FilledFile returns a file that filled with sz bytes of 0x00.
func MkTestFile ¶
MkTestFile creates a test file in the directory dir, and copies the content into it.
func MkTestFileName ¶
MkTestFileName creates a test file at the path, and copies the content into it.
func PrepareDir ¶
PrepareDir creates a directory with test files.
func RandString ¶
func TestAuthServer ¶
TestAuthServer returns a test HTTP server that responds with the test auth info TestAuthTestInfo. The caller should close the server when done.
Types ¶
This section is empty.