Skip to content

Commit cc29d32

Browse files
author
pjbreaux
authored
Merge pull request #630 from caphrim007/bugfix.complete-coverage-bigip-init
Completes test coverage of bigip __init__ class
2 parents 76f41b7 + 33881be commit cc29d32

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

f5/bigip/test/test___init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ def test___get__attr(FakeBigIP):
5555
assert FakeBigIP.hostname == 'FakeHostName'
5656

5757

58+
def test_invalid_args():
59+
with pytest.raises(TypeError) as err:
60+
BigIP('FakeHostName', 'admin', 'admin', badArgs='foobar')
61+
assert 'Unexpected **kwargs' in err.value.message
62+
63+
64+
def test_icontrol_version(FakeBigIPWithPort):
65+
assert hasattr(FakeBigIPWithPort, 'icontrol_version')
66+
67+
5868
def test_non_default_port_number(FakeBigIPWithPort):
5969
uri = urlparse.urlsplit(FakeBigIPWithPort._meta_data['uri'])
6070
assert uri.port == 10443

test/functional/test/__init__.py

Whitespace-only changes.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2016 F5 Networks Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import pytest
16+
17+
from f5.bigip import ManagementRoot
18+
19+
20+
def test_invalid_args(opt_bigip, opt_username, opt_password, opt_port):
21+
with pytest.raises(TypeError) as err:
22+
ManagementRoot(opt_bigip, opt_username, opt_password, port=opt_port,
23+
badArgs='foobar')
24+
assert 'Unexpected **kwargs' in err.value.message
25+
26+
27+
def test_icontrol_version(opt_bigip, opt_username, opt_password, opt_port):
28+
m = ManagementRoot(opt_bigip, opt_username, opt_password, port=opt_port)
29+
assert hasattr(m, 'icontrol_version')

0 commit comments

Comments
 (0)