Skip to content

Commit

Permalink
Merge pull request #50 from robinmatz/49-code-formatting
Browse files Browse the repository at this point in the history
Code Formatting (#49)
  • Loading branch information
samuelpcabral authored Jan 17, 2022
2 parents 817992a + 3f335c7 commit 01bff86
Show file tree
Hide file tree
Showing 12 changed files with 484 additions and 348 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
ignore = E501
8 changes: 6 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get install -y xvfb x3270 locales
python -m pip install -r robotframework_mainframe3270.egg-info/requires.txt
python -m pip install -r requirements-dev.txt
- name: Ensure code formatting
run: |
inv lint
- name: Run tests
run: |
sudo locale-gen en_US
LANG=en_US.iso88591 xvfb-run robot --exclude No-CI --loglevel DEBUG tests
LANG=en_US.iso88591 xvfb-run robot --exclude no-ci --loglevel DEBUG tests
- uses: actions/upload-artifact@v2
if: ${{ always() }}
Expand Down
21 changes: 17 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
# IDE
.idea
.vscode

# byte compiled / optimized
*.pyc
__pychache__

# Robot outputs
log.html
output.xml
report.html
tests/log.html
tests/output.xml
tests/report.html
tests/screenshot/
tests/logs/
.idea/
report.html
output.xml
log.html
tests/screenshots/

# Python virtual environment
.venv
.env
venv
env
26 changes: 10 additions & 16 deletions Mainframe3270/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class Mainframe3270(DynamicCore):
"""
r"""
Mainframe3270 is a library for Robot Framework based on [https://pypi.org/project/py3270/|py3270 project],
a Python interface to x3270, an IBM 3270 terminal emulator. It provides an API to a x3270 or s3270 subprocess.
Expand All @@ -35,7 +35,7 @@ class Mainframe3270(DynamicCore):
| Open Connection Hostname LUname
| Change Wait Time 0.4
| Change Wait Time After Write 0.4
| Set Screenshot Folder C:\\\Temp\\\IMG
| Set Screenshot Folder C:\\Temp\\IMG
| ${value} Read 3 10 17
| Page Should Contain String ENTER APPLICATION
| Wait Field Detected
Expand All @@ -45,17 +45,17 @@ class Mainframe3270(DynamicCore):
| Close Connection
"""

ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
ROBOT_LIBRARY_SCOPE = "TEST SUITE"
ROBOT_LIBRARY_VERSION = VERSION

def __init__(
self,
visible=True,
timeout='30',
wait_time='0.5',
wait_time_after_write='0',
img_folder='.',
run_on_failure_keyword='Take Screenshot'
timeout="30",
wait_time="0.5",
wait_time_after_write="0",
img_folder=".",
run_on_failure_keyword="Take Screenshot",
):
"""
You can change to hide the emulator screen set the argument visible=${False}
Expand All @@ -69,13 +69,7 @@ def __init__(
self._running_on_failure_keyword = False
self.register_run_on_failure_keyword(run_on_failure_keyword)
libraries = [
x3270(
visible,
timeout,
wait_time,
wait_time_after_write,
img_folder
)
x3270(visible, timeout, wait_time, wait_time_after_write, img_folder)
]
DynamicCore.__init__(self, libraries)

Expand All @@ -87,7 +81,7 @@ def register_run_on_failure_keyword(self, keyword):
You can set ``None`` to this keyword, if you do not want to run any keyword on failure.
"""
if keyword.lower() == 'none':
if keyword.lower() == "none":
self.run_on_failure_keyword = None
else:
self.run_on_failure_keyword = keyword
Expand Down
Loading

0 comments on commit 01bff86

Please sign in to comment.