Martin Cosyns | bf2daa0 | 2021-09-29 13:23:45 +0200 | [diff] [blame] | 1 | # Copyright 2020-present Open Networking Foundation |
| 2 | # Original copyright 2020-present ADTRAN, Inc. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | |
| 15 | *** Settings *** |
| 16 | Documentation Library test suite for the kafka_robot library. Due to a missing Kafka server offline test can be |
| 17 | ... executed only. |
| 18 | Library OperatingSystem WITH NAME os |
| 19 | Library String |
| 20 | |
| 21 | *** Test Cases *** |
| 22 | Library import |
| 23 | [Documentation] Checks if the kafka_robot library can be imported. |
| 24 | Import Library kafka_robot.KafkaClient WITH NAME kafka |
| 25 | |
| 26 | Library Version |
| 27 | [Documentation] Determines the version of the installed package and compares it with the returned version of the |
| 28 | ... corresponding keyword. |
| 29 | ${lib_version} kafka.Library Version Get |
| 30 | ${pip show} Run python3 -m pip show kafka-robot | grep Version |
| 31 | ${pip show} Split To Lines ${pip show} |
| 32 | FOR ${line} IN @{pip show} |
| 33 | ${is_version} Evaluate '${line}'.startswith('Version') |
| 34 | Continue For Loop If not ${is_version} |
| 35 | ${pip_version} Evaluate '${line}'.split(':')[-1].strip() |
| 36 | Should Be Equal ${pip_version} ${lib_version} |
| 37 | END |
| 38 | |
| 39 | Keywords |
| 40 | [Documentation] Checks if the keyword name exists in the library's keyword list. |
| 41 | Keyword Should Exist kafka.Connection Close |
| 42 | Keyword Should Exist kafka.Connection Open |
| 43 | Keyword Should Exist kafka.Records Clear |
| 44 | Keyword Should Exist kafka.Records Get |
| 45 | Keyword Should Exist kafka.Subscribe |
| 46 | Keyword Should Exist kafka.Unsubscribe |