Skip to content

Commit c53a8f8

Browse files
committed
feat: pythontests
1 parent eecf6d8 commit c53a8f8

File tree

4 files changed

+54
-3
lines changed

4 files changed

+54
-3
lines changed

tests/languages/dart/tests.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void main() async {
9393
print(Query.notEqual('title', 'Spiderman'));
9494
print(Query.lesser('releasedYear', 1990));
9595
print(Query.greater('releasedYear', [1990, 1999]));
96-
print(Query.search('name', "john"));
96+
print(Query.search('name', 'john'));
9797

9898
// Permission & Role helper tests
9999
print(Permission.read(Role.any()));

tests/languages/flutter/tests.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void main() async {
113113
print(Query.notEqual('title', 'Spiderman'));
114114
print(Query.lesser('releasedYear', 1990));
115115
print(Query.greater('releasedYear', [1990, 1999]));
116-
print(Query.search('name', "john"));
116+
print(Query.search('name', 'john'));
117117

118118
// Permission & Role helper tests
119119
print(Permission.read(Role.any()));

tests/languages/php/test.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
include __DIR__ . '/../../sdks/php/src/Appwrite/Client.php';
44
include __DIR__ . '/../../sdks/php/src/Appwrite/Service.php';
55
include __DIR__ . '/../../sdks/php/src/Appwrite/InputFile.php';
6+
include __DIR__ . '/../../sdks/php/src/Appwrite/Query.php';
7+
include __DIR__ . '/../../sdks/php/src/Appwrite/Permission.php';
8+
include __DIR__ . '/../../sdks/php/src/Appwrite/Role.php';
9+
include __DIR__ . '/../../sdks/php/src/Appwrite/ID.php';
610
include __DIR__ . '/../../sdks/php/src/Appwrite/AppwriteException.php';
711
include __DIR__ . '/../../sdks/php/src/Appwrite/Services/Foo.php';
812
include __DIR__ . '/../../sdks/php/src/Appwrite/Services/Bar.php';
@@ -11,6 +15,10 @@
1115
use Appwrite\AppwriteException;
1216
use Appwrite\Client;
1317
use Appwrite\InputFile;
18+
use Appwrite\Query;
19+
use Appwrite\Permission;
20+
use Appwrite\Role;
21+
use Appwrite\ID;
1422
use Appwrite\Services\Bar;
1523
use Appwrite\Services\Foo;
1624
use Appwrite\Services\General;
@@ -94,3 +102,22 @@
94102
}
95103

96104
$general->empty();
105+
106+
// Query helper tests
107+
echo Query::equal('title', ['Spiderman', 'Dr. Strange']) . "\n";
108+
echo Query::notEqual('title', 'Spiderman') . "\n";
109+
echo Query::lesser('releasedYear', 1990) . "\n";
110+
echo Query::greater('releasedYear', [1990, 1999]) . "\n";
111+
echo Query::search('name', "john") . "\n";
112+
113+
// Permission & Role helper tests
114+
echo Permission::read(Role::any()) . "\n";
115+
echo Permission::write(Role::user(ID::custom('userid'))) . "\n";
116+
echo Permission::create(Role::users()) . "\n";
117+
echo Permission::update(Role::guests()) . "\n";
118+
echo Permission::delete(Role::team('teamId', 'owner')) . "\n";
119+
echo Permission::delete(Role::team('teamId')) . "\n";
120+
121+
// ID helper tests
122+
echo ID::unique() . "\n";
123+
echo ID::custom('custom_id') . "\n";

tests/languages/python/tests.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
from appwrite.services.general import General
55
from appwrite.exception import AppwriteException
66
from appwrite.input_file import InputFile
7+
from appwrite.query import Query
8+
from appwrite.permission import Permission
9+
from appwrite.role import Role
10+
from appwrite.id import ID
11+
712
import os.path
813

914

@@ -85,4 +90,23 @@
8590
except AppwriteException as e:
8691
print(e.message)
8792

88-
general.empty()
93+
general.empty()
94+
95+
# Query helper tests
96+
print(Query.equal('title', ['Spiderman', 'Dr. Strange']));
97+
print(Query.notEqual('title', 'Spiderman'));
98+
print(Query.lesser('releasedYear', 1990));
99+
print(Query.greater('releasedYear', [1990, 1999]));
100+
print(Query.search('name', 'john'));
101+
102+
# Permission & Role helper tests
103+
print(Permission.read(Role.any()));
104+
print(Permission.write(Role.user(ID.custom('userid'))));
105+
print(Permission.create(Role.users()));
106+
print(Permission.update(Role.guests()));
107+
print(Permission.delete(Role.team('teamId', 'owner')));
108+
print(Permission.delete(Role.team('teamId')));
109+
110+
# ID helper tests
111+
print(ID.unique());
112+
print(ID.custom('custom_id'));

0 commit comments

Comments
 (0)