feat(queryAsPath): implement endpoints

This commit is contained in:
js0ny 2025-11-21 19:26:38 +00:00
parent 2016f35dcb
commit 4de3f712d2
14 changed files with 295 additions and 9 deletions

View file

@ -0,0 +1,35 @@
meta {
name: capacity = 4
type: http
seq: 3
}
get {
url: {{API_BASE}}/queryAsPath/capacity/4
body: none
auth: inherit
}
assert {
res.body: length 2
}
tests {
test("Status code is 200", function() {
expect(res.status).to.equal(200);
});
test("Response body is a JSON array", function() {
expect(res.getBody()).to.be.an('array');
});
test("Array is not empty and contains Strings", function() {
const data = res.getBody();
expect(data[0]).to.be.a('string'); // data should be in string
});
}
settings {
encodeUrl: true
timeout: 0
}

View file

@ -0,0 +1,35 @@
meta {
name: capacity = 8.0
type: http
seq: 2
}
get {
url: {{API_BASE}}/queryAsPath/capacity/8.0
body: none
auth: inherit
}
assert {
res.body: length 4
}
tests {
test("Status code is 200", function() {
expect(res.status).to.equal(200);
});
test("Response body is a JSON array", function() {
expect(res.getBody()).to.be.an('array');
});
test("Array is not empty and contains Strings", function() {
const data = res.getBody();
expect(data[0]).to.be.a('string'); // data should be in string
});
}
settings {
encodeUrl: true
timeout: 0
}

View file

@ -0,0 +1,35 @@
meta {
name: capacity = 8
type: http
seq: 1
}
get {
url: {{API_BASE}}/queryAsPath/capacity/8
body: none
auth: inherit
}
assert {
res.body: length 4
}
tests {
test("Status code is 200", function() {
expect(res.status).to.equal(200);
});
test("Response body is a JSON array", function() {
expect(res.getBody()).to.be.an('array');
});
test("Array is not empty and contains Strings", function() {
const data = res.getBody();
expect(data[0]).to.be.a('string'); // data should be in string
});
}
settings {
encodeUrl: true
timeout: 0
}

View file

@ -0,0 +1,35 @@
meta {
name: cooling = false
type: http
seq: 5
}
get {
url: {{API_BASE}}/queryAsPath/cooling/false
body: none
auth: inherit
}
assert {
res.body: length 6
}
tests {
test("Status code is 200", function() {
expect(res.status).to.equal(200);
});
test("Response body is a JSON array", function() {
expect(res.getBody()).to.be.an('array');
});
test("Array is not empty and contains Strings", function() {
const data = res.getBody();
expect(data[0]).to.be.a('string'); // data should be in string
});
}
settings {
encodeUrl: true
timeout: 0
}

View file

@ -0,0 +1,8 @@
meta {
name: [GET] queryAsPath
seq: 3
}
auth {
mode: inherit
}

View file

@ -0,0 +1,35 @@
meta {
name: heating = true
type: http
seq: 4
}
get {
url: {{API_BASE}}/queryAsPath/heating/true
body: none
auth: inherit
}
assert {
res.body: length 7
}
tests {
test("Status code is 200", function() {
expect(res.status).to.equal(200);
});
test("Response body is a JSON array", function() {
expect(res.getBody()).to.be.an('array');
});
test("Array is not empty and contains Strings", function() {
const data = res.getBody();
expect(data[0]).to.be.a('string'); // data should be in string
});
}
settings {
encodeUrl: true
timeout: 0
}

View file

@ -0,0 +1,27 @@
meta {
name: invalid = null
type: http
seq: 7
}
get {
url: {{API_BASE}}/queryAsPath/invalid/null
body: none
auth: inherit
}
assert {
res.status: eq 200
}
tests {
test("Status code is 200", function() {
expect(res.status).to.equal(200);
});
}
settings {
encodeUrl: true
timeout: 0
}

View file

@ -0,0 +1,36 @@
meta {
name: maxMoves = 1000
type: http
seq: 6
}
get {
url: {{API_BASE}}/queryAsPath/maxMoves/1000
body: none
auth: inherit
}
assert {
res.body: length 4
res.status : eq 200
}
tests {
test("Status code is 200", function() {
expect(res.status).to.equal(200);
});
test("Response body is a JSON array", function() {
expect(res.getBody()).to.be.an('array');
});
test("Array is not empty and contains Strings", function() {
const data = res.getBody();
expect(data[0]).to.be.a('string'); // data should be in string
});
}
settings {
encodeUrl: true
timeout: 0
}