Skip to content

Commit

Permalink
Disable backup API tests and use ArangoDB 3.7 in travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
joowani committed Aug 28, 2020
1 parent 0163b01 commit 49ddf39
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -8,7 +8,7 @@ python:
services:
- docker
before_install:
- docker create --name arango -p 8529:8529 -e ARANGO_ROOT_PASSWORD=passwd -e ARANGO_LICENSE_KEY=EVALUATION:125f16ada6047bd17eeeefa3f011070510b5fbd9d85122afdeca72c380e7ac83 arangodb/enterprise-preview:3.7.1-rc.1 --server.jwt-secret-keyfile=/tmp/keyfile
- docker create --name arango -p 8529:8529 -e ARANGO_ROOT_PASSWORD=passwd arangodb/arangodb:3.7.2 --server.jwt-secret-keyfile=/tmp/keyfile
- docker cp tests/static/service.zip arango:/tmp/service.zip
- docker cp tests/static/keyfile arango:/tmp/keyfile
- docker start arango
Expand Down
4 changes: 2 additions & 2 deletions arango/backup.py
Expand Up @@ -19,7 +19,7 @@
from arango.request import Request


class Backup(APIWrapper):
class Backup(APIWrapper): # pragma: no cover

def __init__(self, connection, executor):
super(Backup, self).__init__(connection, executor)
Expand Down Expand Up @@ -242,7 +242,7 @@ def restore(self, backup_id):
)

def response_handler(resp):
if resp.is_success: # pragma: no cover
if resp.is_success:
return format_backup_restore(resp.body['result'])
raise BackupRestoreError(resp, request)

Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Expand Up @@ -144,9 +144,9 @@ def pytest_unconfigure(*_): # pragma: no cover
if col_name.startswith('test_collection'):
sys_db.delete_collection(col_name, ignore_missing=True)

# Remove all backups.
for backup_id in sys_db.backup.get()['list'].keys():
sys_db.backup.delete(backup_id)
# # Remove all backups.
# for backup_id in sys_db.backup.get()['list'].keys():
# sys_db.backup.delete(backup_id)


# noinspection PyProtectedMember
Expand Down
7 changes: 5 additions & 2 deletions tests/test_backup.py
@@ -1,5 +1,6 @@
from __future__ import absolute_import, unicode_literals

import pytest
from six import string_types

from arango.errno import (
Expand All @@ -19,6 +20,8 @@


def test_backup_management(sys_db, bad_db):
pytest.skip('Only for ArangoDB enterprise edition')

# Test create backup "foo".
result = sys_db.backup.create(
label='foo',
Expand Down Expand Up @@ -112,8 +115,8 @@ def test_backup_management(sys_db, bad_db):
assert err.value.error_code in {FORBIDDEN, DATABASE_NOT_FOUND}

# Test restore backup.
# result = sys_db.backup.restore(backup_id_foo)
# assert isinstance(result, dict)
result = sys_db.backup.restore(backup_id_foo)
assert isinstance(result, dict)

# Test restore backup with bad database.
with assert_raises(BackupRestoreError) as err:
Expand Down
15 changes: 15 additions & 0 deletions tests/test_database.py
Expand Up @@ -4,6 +4,9 @@

from six import string_types

from arango.aql import AQL
from arango.backup import Backup
from arango.cluster import Cluster
from arango.exceptions import (
DatabaseCreateError,
DatabaseDeleteError,
Expand All @@ -24,6 +27,10 @@
ServerVersionError,
ServerEngineError,
)
from arango.foxx import Foxx
from arango.pregel import Pregel
from arango.replication import Replication
from arango.wal import WAL
from tests.helpers import assert_raises, generate_db_name


Expand All @@ -35,6 +42,14 @@ def test_database_attributes(db, username):
assert db.conn is not None
assert repr(db) == '<StandardDatabase {}>'.format(db.name)

assert isinstance(db.aql, AQL)
assert isinstance(db.backup, Backup)
assert isinstance(db.cluster, Cluster)
assert isinstance(db.foxx, Foxx)
assert isinstance(db.pregel, Pregel)
assert isinstance(db.replication, Replication)
assert isinstance(db.wal, WAL)


def test_database_misc_methods(sys_db, db, bad_db):
# Test get properties
Expand Down

0 comments on commit 49ddf39

Please sign in to comment.