Skip to content

Commit 7af2c79

Browse files
committed
Add db url connect integration tests
1 parent 8cfb1dc commit 7af2c79

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/integration/test_connect.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import os
2+
import pytest
3+
4+
from rethinkdb import r
5+
from tests.helpers import IntegrationTestCaseBase, INTEGRATION_TEST_DB
6+
7+
8+
@pytest.mark.integration
9+
class TestConnect(IntegrationTestCaseBase):
10+
def setup_method(self):
11+
super(TestConnect, self).setup_method()
12+
13+
def test_connect(self):
14+
db_url = "rethinkdb://{host}".format(host=self.rethinkdb_host)
15+
16+
assert self.r.connect(url=db_url) is not None
17+
18+
def test_connect_with_username(self):
19+
db_url = "rethinkdb://admin@{host}".format(host=self.rethinkdb_host)
20+
21+
assert self.r.connect(url=db_url) is not None
22+
23+
def test_connect_to_db(self):
24+
db_url = "rethinkdb://{host}/{database}".format(
25+
host=self.rethinkdb_host,
26+
database=INTEGRATION_TEST_DB
27+
)
28+
29+
assert self.r.connect(url=db_url) is not None

0 commit comments

Comments
 (0)