Skip to content

Commit 22ec50a

Browse files
committed
fix test
1 parent 97ee146 commit 22ec50a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/base_request.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ pub struct TestContext {
130130

131131
pub async fn run(ctx: TestContext, exec_string: String) -> Result<(), anyhow::Error> {
132132
let test_items: Vec<TestItem> = serde_yaml::from_str(&exec_string)?;
133-
log::debug!(target:"testkit","test_plans: {:#?}", test_items);
133+
log::debug!(target:"testkit","test_items: {:#?}", test_items);
134134

135135
let result = base_request(ctx.clone(), &test_items).await;
136136
match result {
@@ -700,18 +700,18 @@ mod tests {
700700
r#"
701701
---
702702
- name: stage1
703-
- POST: {}
703+
POST: {}
704704
headers:
705705
Content-Type: application/json
706706
json:
707707
task: hit the gym
708708
asserts:
709709
ok: $.resp.json.task == "hit the gym"
710-
ok: $.resp.status == $.env.STATUS
710+
ok: $.resp.status == 201
711711
number: $.resp.json.id
712712
string: $.resp.json.task
713713
boolean: $.resp.json.completed
714-
outputs:
714+
exports:
715715
todoResp: $.resp.json.resp_string
716716
- GET: {}
717717
json:
@@ -724,7 +724,7 @@ mod tests {
724724
empty: $.resp.json.empty_str
725725
empty: $.resp.json.empty_arr
726726
null: $.resp.json.null_val
727-
outputs:
727+
exports:
728728
todoId: $.resp.json.tasks[0].id
729729
- PUT: {}
730730
asserts:
@@ -745,14 +745,14 @@ mod tests {
745745
let ctx = TestContext {
746746
plan: Some("plan".into()),
747747
file_source: "file source".into(),
748-
file: "file.tp.yml".into(),
748+
file: "file.tk.yaml".into(),
749749
path: ".".into(),
750750
stage: Some("stage_name".into()),
751751
stage_index: 0,
752752
};
753753
let resp = run(ctx, yaml_str.into()).await;
754754
log::debug!("{:?}", resp);
755-
// assert_ok!(resp);
755+
assert!(resp.is_ok());
756756
m3.assert_hits(1);
757757
m2.assert_hits(1);
758758
m4.assert_hits(1);

0 commit comments

Comments
 (0)