Skip to content

Commit df0f710

Browse files
authored
Merge pull request #272 from MarketSquare/lucagiove-patch-1
Ready for GitHub Actions to build and test
2 parents fc360de + 4f20e8e commit df0f710

File tree

9 files changed

+83
-48
lines changed

9 files changed

+83
-48
lines changed

.github/workflows/pythonapp.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python application
5+
6+
on: [push, pull_request]
7+
8+
jobs:
9+
build:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
#os: [ubuntu-latest, macos-latest, windows-latest]
14+
os: [ubuntu-latest, macos-latest]
15+
python-version: [2.7, 3.6, 3.7, 3.8, pypy2, pypy3]
16+
exclude:
17+
- os: macos-latest
18+
python-version: pypy2
19+
- os: macos-latest
20+
python-version: pypy3
21+
- os: windows-latest
22+
python-version: pypy2
23+
- os: windows-latest
24+
python-version: pypy3
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Set up Python
28+
uses: actions/setup-python@v1.2.0
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
- name: Display Python version
32+
run: python -c "import sys; print(sys.version)"
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install .[test]
36+
pip install -r requirements.txt
37+
- name: Lint with flake8
38+
run: |
39+
pip install flake8
40+
# stop the build if there are Python syntax errors or undefined names
41+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
42+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
43+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
44+
- name: Test with Robot Framework
45+
run: robot --exclude skip --pythonpath src --outputdir ./tests-report --consolecolors ansi tests
46+
- name: Archive Robot Framework Tests Report
47+
uses: actions/upload-artifact@v1
48+
with:
49+
name: rf-tests-report-${{ matrix.os }}-${{ matrix.python-version }}
50+
path: ./tests-report

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/bulkan/robotframework-requests.png?branch=master)](https://travis-ci.org/bulkan/robotframework-requests)
1+
![Python application](https://github.com/MarketSquare/robotframework-requests/workflows/Python%20application/badge.svg?branch=master)
22
[![PyPi downloads](https://img.shields.io/pypi/dm/robotframework-requests.svg)](https://pypi.python.org/pypi/robotframework-requests)
33
[![Latest Version](https://img.shields.io/pypi/v/robotframework-requests.svg)](https://pypi.python.org/pypi/robotframework-requests)
44

setup.py

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
try:
66
from setuptools import setup
7-
except ImportError as error:
7+
except ImportError:
88
from distutils.core import setup
99

10+
VERSION = None
1011
version_file = join(dirname(abspath(__file__)), 'src', 'RequestsLibrary', 'version.py')
11-
1212
with open(version_file) as file:
13-
code = compile(file.read(), version_file, 'exec')
14-
exec(code)
13+
code = compile(file.read(), version_file, 'exec')
14+
exec(code)
1515

1616
DESCRIPTION = """
1717
Robot Framework keyword library wrapper around the HTTP client library requests.
@@ -26,29 +26,28 @@
2626
Topic :: Software Development :: Testing
2727
"""[1:-1]
2828

29-
setup(name = 'robotframework-requests',
30-
version = VERSION,
31-
description = 'Robot Framework keyword library wrapper around requests',
32-
long_description = DESCRIPTION,
33-
author = 'Bulkan Savun Evcimen',
34-
author_email = 'bulkan@gmail.com',
35-
maintainer = 'Luca Giovenzana',
36-
maintainer_email = 'luca@giovenzana.org',
37-
url = 'http://github.com/bulkan/robotframework-requests',
38-
license = 'MIT',
39-
keywords = 'robotframework testing test automation http client requests',
40-
platforms = 'any',
41-
classifiers = CLASSIFIERS.splitlines(),
42-
package_dir = {'' : 'src'},
43-
packages = ['RequestsLibrary'],
29+
setup(name='robotframework-requests',
30+
version=VERSION,
31+
description='Robot Framework keyword library wrapper around requests',
32+
long_description=DESCRIPTION,
33+
author='Bulkan Savun Evcimen',
34+
author_email='bulkan@gmail.com',
35+
maintainer='Luca Giovenzana',
36+
maintainer_email='luca@giovenzana.org',
37+
url='http://github.com/bulkan/robotframework-requests',
38+
license='MIT',
39+
keywords='robotframework testing test automation http client requests',
40+
platforms='any',
41+
classifiers=CLASSIFIERS.splitlines(),
42+
package_dir={'': 'src'},
43+
packages=['RequestsLibrary'],
4444
install_requires=[
4545
'robotframework',
4646
'requests'
4747
],
4848
extras_require={
4949
'test': ['flask']
50-
},
51-
)
50+
})
5251

5352
""" Official release from master
5453
# make sure the setup version has been increased

src/RequestsLibrary/RequestsKeywords.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _create_session(
8888
# Disable requests warnings, useful when you have large number of testcase
8989
# you will observe drastical changes in Robot log.html and output.xml files size
9090
if disable_warnings:
91-
logging.basicConfig() # you need to initialize logging, otherwise you will not see anything from requests
91+
logging.basicConfig() # you need to initialize logging, otherwise you will not see anything from requests
9292
logging.getLogger().setLevel(logging.ERROR)
9393
requests_log = logging.getLogger("requests")
9494
requests_log.setLevel(logging.ERROR)
@@ -99,7 +99,7 @@ def _create_session(
9999
# verify can be a Boolean or a String
100100
if isinstance(verify, bool):
101101
s.verify = verify
102-
elif isinstance(verify, str) or isinstance(verify, unicode):
102+
elif utils.is_string_type(verify):
103103
if verify.lower() == 'true' or verify.lower() == 'false':
104104
s.verify = self.builtin.convert_to_boolean(verify)
105105
else:
@@ -112,7 +112,7 @@ def _create_session(
112112
# cant pass these into the Session anymore
113113
self.timeout = float(timeout) if timeout is not None else None
114114
self.cookies = cookies
115-
self.verify = verify if self.builtin.convert_to_boolean(verify) != True else None
115+
self.verify = verify if self.builtin.convert_to_boolean(verify) is not True else None
116116

117117
s.url = url
118118

src/RequestsLibrary/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def json_pretty_print(content):
6565
def is_string_type(data):
6666
if PY3 and isinstance(data, str):
6767
return True
68-
elif not PY3 and isinstance(data, unicode):
68+
elif not PY3 and isinstance(data, unicode): # noqa
6969
return True
7070
return False
7171

src/RequestsLibrary/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '0.6.5'
1+
VERSION = '0.6.6'

tests/customAuthenticator.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from requests.auth import HTTPBasicAuth
2-
3-
# Example of a keyword that a test author would supply in order to use the
4-
# `Create Custom Session` keyword. Such a keyword can return any subclass
5-
# of `AuthBase`.
6-
# http://docs.python-requests.org/en/master/user/advanced/#custom-authentication
2+
# Example of a keyword that a test author would supply in order to use the
3+
# `Create Custom Session` keyword. Such a keyword can return any subclass
4+
# of `AuthBase`.
5+
# http://docs.python-requests.org/en/master/user/advanced/#custom-authentication
6+
7+
78
def get_custom_auth(user, pwd):
89
return HTTPBasicAuth(user, pwd)

tests/testcase.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Suite Teardown Teardown Flask Http Server And Sessions
1111

1212
*** Test Cases ***
1313
Readme Test
14-
[Tags] get
14+
[Tags] get skip
1515
Create Session github http://api.github.com
1616
Create Session google http://www.google.com
1717
${resp}= Get Request google /

0 commit comments

Comments
 (0)