summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWouter Bolsterlee <uws@xs4all.nl>2012-06-04 22:05:20 +0200
committerWouter Bolsterlee <uws@xs4all.nl>2012-06-04 22:07:51 +0200
commit45db2b5d87dfd25a8f7ecdfd6a1d4b060b8ff42d (patch)
tree4ee0d4fa17c9ad2fb7c4bec9242b962930107892 /tests
parentc524115afdb126d12c59d52deb3cc0f8445f78f0 (diff)
downloadhappybase-45db2b5d87dfd25a8f7ecdfd6a1d4b060b8ff42d.tar.gz
Add table_prefix_separator argument to Connection()
Also cleanup error handling in the constructor. Closes issue #3.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_api.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index de080ce..47b3114 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -27,6 +27,7 @@ TEST_TABLE_NAME = 'test1'
connection = table = None
+
def setup_module():
global connection, table
connection = happybase.Connection(host=HAPPYBASE_HOST,
@@ -78,10 +79,15 @@ def test_prefix():
assert_equal(connection.table('foobar').name, TABLE_PREFIX + '_foobar')
assert_equal(connection.table('foobar', use_prefix=False).name, 'foobar')
- # connection without table prefix;
c = happybase.Connection(autoconnect=False)
assert_equal('foo', c._table_name('foo'))
+ with assert_raises(TypeError):
+ happybase.Connection(autoconnect=False, table_prefix=123)
+
+ with assert_raises(TypeError):
+ happybase.Connection(autoconnect=False, table_prefix_separator=2.1)
+
def test_stringify():
str(connection)