From 5da23cd4e7e8b8a5758f7890501e4e6caa66c5c2 Mon Sep 17 00:00:00 2001 From: Adam Grandquist Date: Thu, 21 Mar 2019 19:30:16 -0700 Subject: [PATCH 1/2] Test dump/restore loop. --- tests/integration/test_dump.py | 11 +++++++++++ tests/integration/test_restore.py | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/integration/test_dump.py create mode 100644 tests/integration/test_restore.py diff --git a/tests/integration/test_dump.py b/tests/integration/test_dump.py new file mode 100644 index 00000000..c165fb28 --- /dev/null +++ b/tests/integration/test_dump.py @@ -0,0 +1,11 @@ +from subprocess import run + +import pytest + +from tests.helpers import IntegrationTestCaseBase + + +@pytest.mark.integration +class TestDump(IntegrationTestCaseBase): + def test_dump(self): + run(["rethinkdb-dump", "-c", self.rethinkdb_host]) diff --git a/tests/integration/test_restore.py b/tests/integration/test_restore.py new file mode 100644 index 00000000..037f72ac --- /dev/null +++ b/tests/integration/test_restore.py @@ -0,0 +1,11 @@ +from subprocess import run + +import pytest + +from tests.helpers import IntegrationTestCaseBase + + +@pytest.mark.integration +class TestRestore(IntegrationTestCaseBase): + def test_restore(self): + run(["rethinkdb-restore", "-c", self.rethinkdb_host]) From 802e838147473842b52664079cd596bb6b832ed2 Mon Sep 17 00:00:00 2001 From: Adam Grandquist Date: Thu, 21 Mar 2019 19:39:41 -0700 Subject: [PATCH 2/2] Add to `collect_ignore`. --- tests/conftest.py | 10 +++++++--- tests/integration/test_dump.py | 3 ++- tests/integration/test_restore.py | 3 ++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9b2afe4a..e2df9001 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,6 +2,10 @@ collect_ignore = [] if sys.version_info < (3, 4): - collect_ignore += ["integration/test_asyncio.py", "integration/test_asyncio_coroutine.py"] -elif sys.version_info < (3, 6): - collect_ignore.append("integration/test_asyncio.py") \ No newline at end of file + collect_ignore.extend([ + "integration/test_asyncio_coroutine.py", + "integration/test_dump.py", + "integration/test_restore.py", + ]) +if sys.version_info < (3, 6): + collect_ignore.append("integration/test_asyncio.py") diff --git a/tests/integration/test_dump.py b/tests/integration/test_dump.py index c165fb28..69e0f374 100644 --- a/tests/integration/test_dump.py +++ b/tests/integration/test_dump.py @@ -8,4 +8,5 @@ @pytest.mark.integration class TestDump(IntegrationTestCaseBase): def test_dump(self): - run(["rethinkdb-dump", "-c", self.rethinkdb_host]) + status = run(["rethinkdb-dump", "-c", self.rethinkdb_host]) + assert status.returncode == 0, status.stderr diff --git a/tests/integration/test_restore.py b/tests/integration/test_restore.py index 037f72ac..af9b170a 100644 --- a/tests/integration/test_restore.py +++ b/tests/integration/test_restore.py @@ -8,4 +8,5 @@ @pytest.mark.integration class TestRestore(IntegrationTestCaseBase): def test_restore(self): - run(["rethinkdb-restore", "-c", self.rethinkdb_host]) + status = run(["rethinkdb-restore", "-c", self.rethinkdb_host]) + assert status.returncode == 0, status.stderr