diff --git a/shaker/engine/utils.py b/shaker/engine/utils.py
index 365d6c5..b03fc9c 100644
--- a/shaker/engine/utils.py
+++ b/shaker/engine/utils.py
@@ -41,9 +41,10 @@ def read_file(file_name):
def split_address(address):
- host, port = address.split(':')
- if not port:
- raise Exception('Invalid address: %s', address)
+ try:
+ host, port = address.split(':')
+ except ValueError:
+ raise ValueError('Invalid address: %s, "host:port" expected', address)
return host, port
diff --git a/test-requirements.txt b/test-requirements.txt
index c412981..579e2ec 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -6,5 +6,7 @@
hacking>=0.8.0,<0.9
mock>=1.0
python-subunit>=0.0.18
+sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
+sphinxcontrib-httpdomain
testrepository>=0.0.18
testtools>=0.9.36,!=1.2.0
diff --git a/tests/test_utils.py b/tests/test_utils.py
new file mode 100644
index 0000000..ba4d3aa
--- /dev/null
+++ b/tests/test_utils.py
@@ -0,0 +1,30 @@
+# Copyright (c) 2015 Mirantis Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import testtools
+
+from shaker.engine import utils
+
+
+class TestUtils(testtools.TestCase):
+ def setUp(self):
+ super(TestUtils, self).setUp()
+
+ def test_split_address_valid(self):
+ self.assertEqual(('10.0.0.1', '6777'),
+ utils.split_address('10.0.0.1:6777'))
+
+ def test_split_address_invalid(self):
+ self.assertRaises(ValueError, utils.split_address, 'erroneous')
diff --git a/tox.ini b/tox.ini
index 9a2a545..1bd7fdc 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py34,py27,pep8,bashate
+envlist = py34,py27,pep8,bashate,docs
minversion = 1.6
skipsdist = True
@@ -37,6 +37,9 @@ commands =
[tox:jenkins]
downloadcache = ~/cache/pip
+[testenv:docs]
+commands = python setup.py build_sphinx
+
[flake8]
# E125 continuation line does not distinguish itself from next logical line
ignore = E125