Skip to content

Commit

Permalink
Remove more Type tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcook committed Oct 17, 2024
1 parent c3dbbc5 commit 927c6a1
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 126 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
ELASTIC_CREDS:
PROTOCOL: HTTP
strategy:
fail-fast: false
matrix:
# We test on four versions of Lua
lua: [lua5.1, lua5.2, lua5.3, lua5.4, luajit2.0]
Expand Down
33 changes: 0 additions & 33 deletions tests/endpoints/IndicesTest/GetFieldMappingTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,39 +58,6 @@ function requestIndexTest()
assert_nil(err)
end

-- Testing name request
function requestTypeTest()
mockTransport.method = "GET"
mockTransport.uri = "/_mapping/tweet/field/text"
mockTransport.params = {}
mockTransport.body = nil

endpoint:setParams{
type = "tweet",
fields = "text"
}

local _, err = endpoint:request()
assert_nil(err)
end

-- Testing index and name request
function requestIndexTypeTest()
mockTransport.method = "GET"
mockTransport.uri = "/twitter/_mapping/tweet/field/text"
mockTransport.params = {}
mockTransport.body = nil

endpoint:setParams{
index = "twitter",
type = "tweet",
fields = "text"
}

local _, err = endpoint:request()
assert_nil(err)
end

-- Testing error
function requestErrorTest()
mockTransport.method = "GET"
Expand Down
33 changes: 1 addition & 32 deletions tests/endpoints/IndicesTest/GetMappingTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,4 @@ function requestIndexTest()

local _, err = endpoint:request()
assert_nil(err)
end

-- Testing name request
function requestTypeTest()
mockTransport.method = "GET"
mockTransport.uri = "/_mapping/user_12"
mockTransport.params = {}
mockTransport.body = nil

endpoint:setParams{
type = "user_12"
}

local _, err = endpoint:request()
assert_nil(err)
end

-- Testing index and name request
function requestIndexTypeTest()
mockTransport.method = "GET"
mockTransport.uri = "/users/_mapping/user_12"
mockTransport.params = {}
mockTransport.body = nil

endpoint:setParams{
index = "users",
type = "user_12"
}

local _, err = endpoint:request()
assert_nil(err)
end
end
30 changes: 0 additions & 30 deletions tests/endpoints/IndicesTest/PutMappingTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,33 +55,3 @@ function requestIndexTest()
assert_not_nil(err)
end

-- Testing name request
function requestTypeTest()
mockTransport.method = "PUT"
mockTransport.uri = "/_mapping/user_12"
mockTransport.params = {}
mockTransport.body = nil

endpoint:setParams{
type = "user_12"
}

local _, err = endpoint:request()
assert_nil(err)
end

-- Testing index and name request
function requestIndexTypeTest()
mockTransport.method = "PUT"
mockTransport.uri = "/users/_mapping/user_12"
mockTransport.params = {}
mockTransport.body = nil

endpoint:setParams{
index = "users",
type = "user_12"
}

local _, err = endpoint:request()
assert_nil(err)
end
31 changes: 0 additions & 31 deletions tests/endpoints/IndicesTest/ValidateQueryTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,34 +54,3 @@ function requestIndexTest()
local _, err = endpoint:request()
assert_nil(err)
end

-- Testing type request
function requestTypeTest()
mockTransport.method = "GET"
mockTransport.uri = "/tweet/_validate/query"
mockTransport.params = {}
mockTransport.body = nil

endpoint:setParams{
type = "tweet"
}

local _, err = endpoint:request()
assert_nil(err)
end

-- Testing index and type request
function requestIndexTypeTest()
mockTransport.method = "GET"
mockTransport.uri = "/twitter/tweet/_validate/query"
mockTransport.params = {}
mockTransport.body = nil

endpoint:setParams{
index = "twitter",
type = "tweet"
}

local _, err = endpoint:request()
assert_nil(err)
end

0 comments on commit 927c6a1

Please sign in to comment.