MCPcopy
hub / github.com/autobrr/qui / TestBuildSearchParams

Function TestBuildSearchParams

internal/services/jackett/service_test.go:925–1078  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

923}
924
925func TestBuildSearchParams(t *testing.T) {
926 s := &Service{}
927 tests := []struct {
928 name string
929 req *TorznabSearchRequest
930 searchMode string
931 expected map[string]string
932 }{
933 {
934 name: "basic query",
935 req: &TorznabSearchRequest{
936 Query: "test movie",
937 },
938 expected: map[string]string{
939 "t": "search",
940 "q": "test movie",
941 },
942 },
943 {
944 name: "query with categories",
945 req: &TorznabSearchRequest{
946 Query: "test show",
947 Categories: []int{CategoryTV, CategoryTVHD},
948 },
949 expected: map[string]string{
950 "t": "search",
951 "q": "test show",
952 "cat": "5000,5040",
953 },
954 },
955 {
956 name: "query with IMDb ID",
957 req: &TorznabSearchRequest{
958 Query: "The Matrix",
959 IMDbID: "tt0133093",
960 },
961 expected: map[string]string{
962 "t": "search",
963 "q": "The Matrix",
964 "imdbid": "0133093",
965 },
966 },
967 {
968 name: "query with IMDb ID without tt prefix",
969 req: &TorznabSearchRequest{
970 Query: "The Matrix",
971 IMDbID: "0133093",
972 },
973 expected: map[string]string{
974 "t": "search",
975 "q": "The Matrix",
976 "imdbid": "0133093",
977 },
978 },
979 {
980 name: "query with TVDb ID",
981 req: &TorznabSearchRequest{
982 Query: "Breaking Bad",

Callers

nothing calls this directly

Calls 3

buildSearchParamsMethod · 0.95
RunMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected