mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 04:17:15 +02:00
fixed hostname not split (+) in python (#609)
* fixed hostname not split (+) in python * also for rx_hostname
This commit is contained in:
@ -341,4 +341,33 @@ def test_merge_args_tuple():
|
||||
assert merge_args(*("a", "b"), 5) == ("a", "b", 5)
|
||||
|
||||
def test_merge_args_dict_with_tuple():
|
||||
assert merge_args({0: (1,2)}, 3) == ({0: (1,2,3)},)
|
||||
assert merge_args({0: (1,2)}, 3) == ({0: (1,2,3)},)
|
||||
|
||||
|
||||
def test_hostname_to_list():
|
||||
s = "localhost"
|
||||
r = hostname_list(s)
|
||||
assert r == [s]
|
||||
|
||||
def test_hostname_to_list_passthrough():
|
||||
args = ["localhost"]
|
||||
ret = hostname_list(args)
|
||||
assert ret == args
|
||||
|
||||
args = ("localhost",)
|
||||
ret = hostname_list(args)
|
||||
assert ret == args
|
||||
|
||||
def test_splitting_hostname():
|
||||
args = 'apple+banana+pear+'
|
||||
ret = hostname_list(args)
|
||||
assert ret == ['apple', 'banana', 'pear']
|
||||
|
||||
#not sensitive to trailing +
|
||||
args = 'apple+banana+pear'
|
||||
ret = hostname_list(args)
|
||||
assert ret == ['apple', 'banana', 'pear']
|
||||
|
||||
def test_hostame_throws_on_wrong_args():
|
||||
with pytest.raises(Exception) as e:
|
||||
hostname_list(5)
|
||||
|
Reference in New Issue
Block a user