mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
Update codegens
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import 'package:apidash/codegen/codegen.dart';
|
||||
import 'package:apidash/consts.dart';
|
||||
import 'package:test/test.dart';
|
||||
import '../request_models.dart';
|
||||
import '../models/request_models.dart';
|
||||
|
||||
void main() {
|
||||
final codeGen = Codegen();
|
||||
@ -32,8 +32,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelGet1, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelGet1, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('GET2', () {
|
||||
@ -61,8 +60,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelGet2, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelGet2, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('GET3', () {
|
||||
@ -90,8 +88,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelGet3, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelGet3, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('GET4', () {
|
||||
@ -119,8 +116,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelGet4, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelGet4, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('GET5', () {
|
||||
@ -153,8 +149,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelGet5, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelGet5, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('GET6', () {
|
||||
@ -187,8 +182,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelGet6, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelGet6, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('GET7', () {
|
||||
@ -216,8 +210,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelGet7, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelGet7, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('GET8', () {
|
||||
@ -250,8 +243,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelGet8, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelGet8, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('GET9', () {
|
||||
@ -279,8 +271,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelGet9, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelGet9, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('GET10', () {
|
||||
@ -313,8 +304,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelGet10, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelGet10, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('GET11', () {
|
||||
@ -347,8 +337,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelGet11, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelGet11, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('GET12', () {
|
||||
@ -376,8 +365,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelGet12, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelGet12, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
});
|
||||
@ -408,8 +396,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelHead1, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelHead1, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('HEAD2', () {
|
||||
@ -437,8 +424,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelHead2, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelHead2, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
});
|
||||
@ -478,8 +464,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelPost1, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelPost1, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('POST2', () {
|
||||
@ -522,8 +507,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelPost2, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelPost2, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('POST3', () {
|
||||
@ -562,8 +546,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelPost3, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelPost3, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('POST4', () {
|
||||
@ -606,8 +589,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelPost4, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelPost4, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('POST5', () {
|
||||
@ -655,8 +637,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelPost5, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelPost5, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('POST6', () {
|
||||
@ -695,8 +676,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelPost6, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelPost6, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('POST7', () {
|
||||
@ -735,8 +715,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelPost7, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelPost7, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('POST8', () {
|
||||
@ -779,8 +758,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelPost8, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelPost8, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
test('POST9', () {
|
||||
@ -825,8 +803,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelPost9, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelPost9, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
});
|
||||
@ -868,8 +845,7 @@ fn main() {
|
||||
println!("Response code: {}", easy.response_code().unwrap());
|
||||
}""";
|
||||
expect(
|
||||
codeGen.getCode(
|
||||
CodegenLanguage.rustCurl, requestModelPut1, "https"),
|
||||
codeGen.getCode(CodegenLanguage.rustCurl, requestModelPut1, "https"),
|
||||
expectedCode);
|
||||
});
|
||||
});
|
||||
@ -988,5 +964,4 @@ fn main() {
|
||||
expectedCode);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user