def test_record_not_found(self): with pytest.raises(TargetdError) as td: display_discovery(None, "test") assert str(td.value) == 'Discovery record [test,3260] not found.'
def test_validate_string_two(self): with pytest.raises(TargetdError) as td: display_discovery(None, "1" * 256) assert str(td.value) == 'String too long'
def test_validate_string_three(self): with pytest.raises(TargetdError) as td: display_discovery(None, "\xea\x80\x80abcd\xde\xb4") assert str(td.value) == 'Not a ascii-encoded unicode string'
def test_discovery_method_error(self): with pytest.raises(TargetdError) as td: display_discovery(None, sam_tst_host, "test") assert str(td.value) == ('Invalid value. Possible values' ' are : sendtargets, isns')
def test_validate_string_one(self): with pytest.raises(TargetdError) as td: display_discovery(None, "") assert str(td.value) == 'Unauthorised empty string'
def test_validate_string_two(self): with pytest.raises(TargetdError) as td: display_discovery(None, "1"*256) assert str(td.value) == 'String too long'