11import '../lib/packageName.dart' ;
2+ import '../lib/models.dart' ;
23
34void main () async {
45 Client client = Client ();
@@ -8,64 +9,65 @@ void main() async {
89
910 client.setSelfSigned ();
1011 client.setProject ('console' );
11- client.setEndPointRealtime ("wss://demo.appwrite.io/v1" ); // change this later to appwrite.io
12+ client.setEndPointRealtime (
13+ "wss://demo.appwrite.io/v1" ); // change this later to appwrite.io
1214
1315 Realtime realtime = Realtime (client);
1416 final rtsub = realtime.subscribe (["tests" ]);
1517
16- await Future .delayed (Duration (seconds: 4 ));
18+ await Future .delayed (Duration (seconds: 5 ));
1719 client.addHeader ('Origin' , 'http://localhost' );
1820 // Foo Tests
1921 print ('\n Test Started' );
2022
21- Response response;
23+ Mock response;
2224 response = await foo.get (x: 'string' , y: 123 , z: ['string in array' ]);
23- print (response.data[ ' result' ] );
25+ print (response.result);
2426
2527 response = await foo.post (x: 'string' , y: 123 , z: ['string in array' ]);
26- print (response.data[ ' result' ] );
28+ print (response.result);
2729
2830 response = await foo.put (x: 'string' , y: 123 , z: ['string in array' ]);
29- print (response.data[ ' result' ] );
31+ print (response.result);
3032
3133 response = await foo.patch (x: 'string' , y: 123 , z: ['string in array' ]);
32- print (response.data[ ' result' ] );
34+ print (response.result);
3335
3436 response = await foo.delete (x: 'string' , y: 123 , z: ['string in array' ]);
35- print (response.data[ ' result' ] );
37+ print (response.result);
3638
3739 // Bar Tests
3840
3941 response =
4042 await bar.get (xrequired: 'string' , xdefault: 123 , z: ['string in array' ]);
41- print (response.data[ ' result' ] );
43+ print (response.result);
4244
4345 response = await bar
4446 .post (xrequired: 'string' , xdefault: 123 , z: ['string in array' ]);
45- print (response.data[ ' result' ] );
47+ print (response.result);
4648
4749 response =
4850 await bar.put (xrequired: 'string' , xdefault: 123 , z: ['string in array' ]);
49- print (response.data[ ' result' ] );
51+ print (response.result);
5052
5153 response = await bar
5254 .patch (xrequired: 'string' , xdefault: 123 , z: ['string in array' ]);
53- print (response.data[ ' result' ] );
55+ print (response.result);
5456
5557 response = await bar
5658 .delete (xrequired: 'string' , xdefault: 123 , z: ['string in array' ]);
57- print (response.data[ ' result' ] );
59+ print (response.result);
5860
5961 // General Tests
6062
61- response = await general.redirect ();
62- print (response.data ['result' ]);
63+ final res = await general.redirect ();
64+ print (res ['result' ]);
6365
6466 final file = await MultipartFile .fromPath ('file' , '../../resources/file.png' ,
6567 filename: 'file.png' );
6668 response = await general.upload (
6769 x: 'string' , y: 123 , z: ['string in array' ], file: file);
68- print (response.data[ ' result' ] );
70+ print (response.result);
6971
7072 try {
7173 await general.error400 ();
@@ -93,8 +95,8 @@ void main() async {
9395 await Future .delayed (Duration (seconds: 5 ));
9496
9597 // response = await general.setCookie();
96- // print(response.data[' result'] );
98+ // print(response.result);
9799
98100 // response = await general.getCookie();
99- // print(response.data[' result'] );
101+ // print(response.result);
100102}
0 commit comments