blob: 19a707100a107bd93f69437594bab2ef33d17310 [file] [log] [blame]
Martin Cosynsf88ed6e2020-12-02 10:30:10 +01001# Copyright 2020 ADTRAN, 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
14*** Settings ***
15Documentation Library test suite for the kafka_robot library. Due to a missing Kafka server offline test can be
16... executed only.
17Library OperatingSystem WITH NAME os
18Library String
19
20*** Test Cases ***
21Library import
22 [Documentation] Checks if the kafka_robot library can be imported.
23 Import Library kafka_robot.KafkaClient WITH NAME kafka
24
25Library Version
26 [Documentation] Determines the version of the installed package and compares it with the returned version of the
27 ... corresponding keyword.
28 ${lib_version} kafka.Library Version Get
29 ${pip show} Run python3 -m pip show kafka-robot | grep Version
30 ${pip show} Split To Lines ${pip show}
31 FOR ${line} IN @{pip show}
32 ${is_version} Evaluate '${line}'.startswith('Version')
33 Continue For Loop If not ${is_version}
34 ${pip_version} Evaluate '${line}'.split(':')[-1].strip()
35 Should Be Equal ${pip_version} ${lib_version}
36 END
37
38Keywords
39 [Documentation] Checks if the keyword name exists in the library's keyword list.
40 Keyword Should Exist kafka.Connection Close
41 Keyword Should Exist kafka.Connection Open
42 Keyword Should Exist kafka.Records Clear
43 Keyword Should Exist kafka.Records Get
44 Keyword Should Exist kafka.Subscribe
45 Keyword Should Exist kafka.Unsubscribe