From 6a620262995663136dc5ec1c6715014fb2408536 Mon Sep 17 00:00:00 2001 From: Tatu Aalto Date: Thu, 13 Jun 2024 22:58:07 +0300 Subject: [PATCH] Add test for entry point --- atest/acceptance/entry_point.robot | 36 ++++++++++++++++++++++ src/SeleniumLibrary/entry/get_versions.py | 2 +- utest/test/translation/test_translation.py | 1 - 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 atest/acceptance/entry_point.robot diff --git a/atest/acceptance/entry_point.robot b/atest/acceptance/entry_point.robot new file mode 100644 index 000000000..a92c3740a --- /dev/null +++ b/atest/acceptance/entry_point.robot @@ -0,0 +1,36 @@ +*** Settings *** +Library Process + + +*** Test Cases *** +Entry Point Version + ${process} = Run Process + ... python -m SeleniumLibrary.entry --version + ... shell=True + ... cwd=${EXECDIR}/src + Log ${process.stdout} + Log ${process.stderr} + Should Be Equal As Integers ${process.rc} 0 + Should Be Empty ${process.stderr} + Should Contain ${process.stdout} Used Python is: + Should Contain ${process.stdout} Installed selenium version is: + +Entry Point Translation + ${process} = Run Process + ... python -m SeleniumLibrary.entry translation ${OUTPUT_DIR}/translation.json + ... shell=True + ... cwd=${EXECDIR}/src + Log ${process.stdout} + Log ${process.stderr} + Should Be Equal As Integers ${process.rc} 0 + Should Be Empty ${process.stderr} + Should Be Equal ${process.stdout} Translation file created in ${OUTPUT_DIR}/translation.json + ${process} = Run Process + ... python -m SeleniumLibrary.entry translation --compare ${OUTPUT_DIR}/translation.json + ... shell=True + ... cwd=${EXECDIR}/src + Log ${process.stdout} + Log ${process.stderr} + Should Be Equal As Integers ${process.rc} 0 + Should Be Empty ${process.stderr} + Should Be Equal ${process.stdout} Translation is valid, no updated needed. diff --git a/src/SeleniumLibrary/entry/get_versions.py b/src/SeleniumLibrary/entry/get_versions.py index 9c78f7d36..51e68da7a 100644 --- a/src/SeleniumLibrary/entry/get_versions.py +++ b/src/SeleniumLibrary/entry/get_versions.py @@ -45,7 +45,7 @@ def get_version(): ) return ( f"\nUsed Python is: {sys.executable}\n\tVersion: {python_version}\n" - f'Robot Framework version: "{get_rf_version()}\n"' + f'Robot Framework version: "{get_rf_version()}"\n' f"Installed SeleniumLibrary version is: {get_library_version()}\n" f"Installed selenium version is: {__version__}\n" ) diff --git a/utest/test/translation/test_translation.py b/utest/test/translation/test_translation.py index c6726a21a..7d1255241 100644 --- a/utest/test/translation/test_translation.py +++ b/utest/test/translation/test_translation.py @@ -8,7 +8,6 @@ @pytest.fixture() def sl() -> SeleniumLibrary: - d = Path(__file__).parent.parent.absolute() sys.path.append(str(Path(__file__).parent.parent.absolute())) return SeleniumLibrary(language="FI")