Skip to content

Commit 472e6a1

Browse files
committed
Move AdminExample base class to client/admin subfolder since that's the only place that uses it.
1 parent 0b12ab3 commit 472e6a1

5 files changed

Lines changed: 10 additions & 19 deletions

File tree

examples/__init__.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,6 @@ def __init__(
3232
def cleanup(self):
3333
self.client.close()
3434

35-
class AdminExample(Example):
36-
def __init__(self):
37-
# TODO: admin user doesn't have enough permissions
38-
super().__init__(user="admin", password="admin")
39-
40-
class ExampleWithUser(AdminExample):
41-
def __init__(self):
42-
super().__init__()
43-
self.user = "foo-example"
44-
self.password = "foobar"
45-
self.client.admin_create_user(self.user, self.password, roles=[])
46-
47-
def cleanup(self):
48-
self.client.admin_drop_user(self.user)
49-
super().cleanup()
50-
5135
class UDFExample(Example):
5236
def __init__(self):
5337
extra_config = {

examples/client/admin/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from ... import Example
2+
3+
4+
class AdminExample(Example):
5+
def __init__(self):
6+
# TODO: admin user doesn't have enough permissions
7+
super().__init__(user="admin", password="admin")

examples/client/admin/create_role.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from __future__ import print_function
1919

2020
import aerospike
21-
from ... import AdminExample
21+
from . import AdminExample
2222

2323

2424
class CreateRole(AdminExample):

examples/client/admin/create_user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from __future__ import print_function
1919

20-
from ... import AdminExample
20+
from . import AdminExample
2121

2222
class CreateUser(AdminExample):
2323
def run(self):

examples/client/admin/query_roles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616
################################################################################
1717

18-
from ... import AdminExample
18+
from . import AdminExample
1919

2020

2121
class QueryRoles(AdminExample):

0 commit comments

Comments
 (0)