From 72432385ad70aeee418890c2741734f3f81e7ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 07:51:18 -0400 Subject: [PATCH 01/19] adding coveralls --- .travis.yml | 5 +++-- tests/ci_requirements.txt | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 tests/ci_requirements.txt diff --git a/.travis.yml b/.travis.yml index 7caeb2ff..84f5c739 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,12 @@ python: - "2.7" # command to install dependencies install: - - pip install nose + - pip install -r tests/ci_requirements.txt before_script: - cp ./tests/example_config ./tests/config # command to run tests -script: nosetests -v +script: COVERAGE=1 nosetests -v +after_success: coveralls notifications: email: - api@shotgunsoftware.com diff --git a/tests/ci_requirements.txt b/tests/ci_requirements.txt new file mode 100644 index 00000000..8bde5710 --- /dev/null +++ b/tests/ci_requirements.txt @@ -0,0 +1,2 @@ +coveralls==1.1 +nose \ No newline at end of file From ca9f45d6d7870836eedd730333b0da79d70562dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 07:56:46 -0400 Subject: [PATCH 02/19] adding badges --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8272db41..761006f5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ +[![VFX Platform](https://img.shields.io/badge/vfxplatform-2018-yellow.svg)](http://www.vfxplatform.com/) +[![Reference Documentation](http://img.shields.io/badge/doc-reference-blue.svg)](http://developer.shotgunsoftware.com/python-api) +[![Build Status Linux](https://secure.travis-ci.org/shotgunsoftware/python-api.svg?branch=master)](http://travis-ci.org/shotgunsoftware/python-api) +[![Build status Windows](https://ci.appveyor.com/api/projects/status/slvw7u4jatvdly98/branch/master?svg=true +)](https://ci.appveyor.com/project/jfboismenu/python-api/branch/master) +[![Coverage Status](https://coveralls.io/repos/github/shotgunsoftware/python-api/badge.svg?branch=master)](https://coveralls.io/github/shotgunsoftware/python-api?branch=master) +[![Linting](https://img.shields.io/badge/PEP8%20by-Hound%20CI-a873d1.svg)](https://houndci.com) + # Shotgun Python API Shotgun provides a simple Python-based API for accessing Shotgun and integrating with other tools. This is the official API that is maintained by Shotgun Software (support@shotgunsoftware.com) @@ -32,9 +40,6 @@ You can see the [full history of the Python API on the documentation site](http: Integration and unit tests are provided. -[![Build Status](https://secure.travis-ci.org/shotgunsoftware/python-api.svg?branch=master)](http://travis-ci.org/shotgunsoftware/python-api) - - - All tests require the [nose unit testing tools](http://nose.readthedocs.org), and a `tests/config` file (you can copy an example from `tests/example_config`). - Tests can be run individually like this: `nosetest tests/test_client.py` - `test_client` and `tests_unit` use mock server interaction and do not require a Shotgun instance to be available (no modifications to `tests/config` are necessary). From ebf09d2a60cba3da71a54cfa5fa6f2ae974742fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 08:12:35 -0400 Subject: [PATCH 03/19] appveyor build --- appveyor.yml | 38 ++++++++++++++++++++++++++++++++++++++ tests/run_appveyor.bat | 16 ++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 appveyor.yml create mode 100644 tests/run_appveyor.bat diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..1769d4b3 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,38 @@ +# Copyright (c) 2017 Shotgun Software Inc. +# +# CONFIDENTIAL AND PROPRIETARY +# +# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit +# Source Code License included in this distribution package. See LICENSE. +# By accessing, using, copying or modifying this work you indicate your +# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights +# not expressly granted therein are reserved by Shotgun Software Inc. + +# https://www.appveyor.com/ Windows CI configuration file. + +environment: + matrix: + - PYTHON: "C:\\Python26" + +environment: + SG_SERVER_URL: + secure: 1klEyyzGkwq7KyTgI+9nqiqCNcdOXLVR/P8nXGgKu2kHj+DDCNNe2LNDLh2h0TIA + SG_API_KEY: + secure: jnC8/rvRGohDM6FA1zDX7RjRKGCHQLPVjC8xfURr4EeMgzpMnoQgL/qjNis47IfwEm4+dI2eN9fDjskfea+o4pTX1gt2rV1fe4qhAxGE4g4= + SG_HUMAN_LOGIN: 'travis-ci' + SG_HUMAN_NAME: 'Travis CI' + SG_HUMAN_PASSWORD: + secure: JAxEsOimGFFr0hYgCd6prUNEdTmUZinPU0516bHs4Jk= + SG_SCRIPT_NAME: 'travis-ci' + +build: off + +test_script: + # Put your test command here. + # If you don't need to build C extensions on 64-bit Python 3.3 or 3.4, + # you can remove "build.cmd" from the front of the command, as it's + # only needed to support those cases. + # Note that you must use the environment variable %PYTHON% to refer to + # the interpreter you're using - Appveyor does not do anything special + # to put the Python version you want to use on PATH. + - "tests\\run_appveyor.bat" diff --git a/tests/run_appveyor.bat b/tests/run_appveyor.bat new file mode 100644 index 00000000..5f16c58d --- /dev/null +++ b/tests/run_appveyor.bat @@ -0,0 +1,16 @@ +:: Copyright (c) 2018 Shotgun Software Inc. +:: +:: CONFIDENTIAL AND PROPRIETARY +:: +:: This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit +:: Source Code License included in this distribution package. See LICENSE. +:: By accessing, using, copying or modifying this work you indicate your +:: agreement to the Shotgun Pipeline Toolkit Source Code License. All rights +:: not expressly granted therein are reserved by Shotgun Software Inc. + +:: +:: This file is run by the appveyor builds. +:: + +%PYTHON%\Scripts\pip install nose +%PYTHON%\Scripts\nosetests.exe -v From 885c31a3415cec7acb4c9b50ff73e9260dd24c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 08:14:13 -0400 Subject: [PATCH 04/19] fixes appveyor.yml structure. --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 1769d4b3..4f7fa950 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,7 +14,7 @@ environment: matrix: - PYTHON: "C:\\Python26" -environment: + # To update these values, visit AppVeyor's site, click the user icon and scroll down to Encrypt Data. SG_SERVER_URL: secure: 1klEyyzGkwq7KyTgI+9nqiqCNcdOXLVR/P8nXGgKu2kHj+DDCNNe2LNDLh2h0TIA SG_API_KEY: From 37d2f43c0fc827938320274bc7fb9c9729079147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 08:26:14 -0400 Subject: [PATCH 05/19] adds the hound --- .flake8 | 49 ++++++++++++++++++++++++++++++++++++++++++ .hound.yml | 16 ++++++++++++++ appveyor.yml | 2 +- tests/run_appveyor.bat | 32 +++++++++++++-------------- 4 files changed, 82 insertions(+), 17 deletions(-) create mode 100644 .flake8 create mode 100644 .hound.yml diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..0b1bc5a5 --- /dev/null +++ b/.flake8 @@ -0,0 +1,49 @@ +# Copyright (c) 2018 Shotgun Software Inc. +# +# CONFIDENTIAL AND PROPRIETARY +# +# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit +# Source Code License included in this distribution package. See LICENSE. +# By accessing, using, copying or modifying this work you indicate your +# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights +# not expressly granted therein are reserved by Shotgun Software Inc. + +# Flake 8 PEP and lint configuration - https://gitlab.com/pycqa/flake8 +# +# This defines the official lint and PEP8 rules for this repository +# +# You can run this locally by doing pep install flake8 and then +# >flake8 /path/to/core +# +# This is also used by the hound CI - see the .hound.yml config file. +# +# +[flake8] + +# things we don't want to lint +exclude = + .git, + .flake8, + .gitignore, + .travis.yml, + .cache, + .eggs, + *.rst, + *.yml, + *.pyc, + *.pyo, + *.egg-info, + __pycache__, + # Those are our third parties, do not lint them! + shotgun_api3/lib/httplib2/*.py + shotgun_api3/lib/simplejson/*.py + shotgun_api3/lib/xmlrpclib.py + +# exceptions +# +# E501 line too long (112 > 79 characters) +# E402 module level import not top of file +# E999 SyntaxError: invalid syntax (hack for hound CI which runs python 3.x) + +ignore = E501, E402, E999 + diff --git a/.hound.yml b/.hound.yml new file mode 100644 index 00000000..18025a11 --- /dev/null +++ b/.hound.yml @@ -0,0 +1,16 @@ +# Copyright (c) 2017 Shotgun Software Inc. +# +# CONFIDENTIAL AND PROPRIETARY +# +# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit +# Source Code License included in this distribution package. See LICENSE. +# By accessing, using, copying or modifying this work you indicate your +# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights +# not expressly granted therein are reserved by Shotgun Software Inc. + +# https://houndci.com configuration file for linting and PEP8 + +python: + enabled: true + config_file: .flake8 + diff --git a/appveyor.yml b/appveyor.yml index 4f7fa950..f7253872 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,7 +24,7 @@ environment: SG_HUMAN_PASSWORD: secure: JAxEsOimGFFr0hYgCd6prUNEdTmUZinPU0516bHs4Jk= SG_SCRIPT_NAME: 'travis-ci' - + build: off test_script: diff --git a/tests/run_appveyor.bat b/tests/run_appveyor.bat index 5f16c58d..014e71e6 100644 --- a/tests/run_appveyor.bat +++ b/tests/run_appveyor.bat @@ -1,16 +1,16 @@ -:: Copyright (c) 2018 Shotgun Software Inc. -:: -:: CONFIDENTIAL AND PROPRIETARY -:: -:: This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit -:: Source Code License included in this distribution package. See LICENSE. -:: By accessing, using, copying or modifying this work you indicate your -:: agreement to the Shotgun Pipeline Toolkit Source Code License. All rights -:: not expressly granted therein are reserved by Shotgun Software Inc. - -:: -:: This file is run by the appveyor builds. -:: - -%PYTHON%\Scripts\pip install nose -%PYTHON%\Scripts\nosetests.exe -v +:: Copyright (c) 2018 Shotgun Software Inc. +:: +:: CONFIDENTIAL AND PROPRIETARY +:: +:: This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit +:: Source Code License included in this distribution package. See LICENSE. +:: By accessing, using, copying or modifying this work you indicate your +:: agreement to the Shotgun Pipeline Toolkit Source Code License. All rights +:: not expressly granted therein are reserved by Shotgun Software Inc. + +:: +:: This file is run by the appveyor builds. +:: + +%PYTHON%\Scripts\pip install nose +%PYTHON%\Scripts\nosetests.exe -v From ff745d9bd6e48f50682ed9d6648259574af8b496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 08:33:42 -0400 Subject: [PATCH 06/19] removing quotes from ci values --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f7253872..7a109533 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,11 +19,11 @@ environment: secure: 1klEyyzGkwq7KyTgI+9nqiqCNcdOXLVR/P8nXGgKu2kHj+DDCNNe2LNDLh2h0TIA SG_API_KEY: secure: jnC8/rvRGohDM6FA1zDX7RjRKGCHQLPVjC8xfURr4EeMgzpMnoQgL/qjNis47IfwEm4+dI2eN9fDjskfea+o4pTX1gt2rV1fe4qhAxGE4g4= - SG_HUMAN_LOGIN: 'travis-ci' - SG_HUMAN_NAME: 'Travis CI' + SG_HUMAN_LOGIN: travis-ci + SG_HUMAN_NAME: Travis CI SG_HUMAN_PASSWORD: secure: JAxEsOimGFFr0hYgCd6prUNEdTmUZinPU0516bHs4Jk= - SG_SCRIPT_NAME: 'travis-ci' + SG_SCRIPT_NAME: travis-ci build: off From 54560758dfafedbbf28010dcf54dbd041a7202c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 08:44:42 -0400 Subject: [PATCH 07/19] moving to 2.7. Python 2.6 is unreliable when it comes to pip installs. --- appveyor.yml | 2 +- tests/run_appveyor.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7a109533..29be3dd8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,7 +12,7 @@ environment: matrix: - - PYTHON: "C:\\Python26" + - PYTHON: "C:\\Python27" # To update these values, visit AppVeyor's site, click the user icon and scroll down to Encrypt Data. SG_SERVER_URL: diff --git a/tests/run_appveyor.bat b/tests/run_appveyor.bat index 014e71e6..57c18b91 100644 --- a/tests/run_appveyor.bat +++ b/tests/run_appveyor.bat @@ -12,5 +12,5 @@ :: This file is run by the appveyor builds. :: -%PYTHON%\Scripts\pip install nose +%PYTHON%\Scripts\pip install -r tests/ci_requirements.txt %PYTHON%\Scripts\nosetests.exe -v From bed03a0e2646e8d029c5b8260e8687d8e279a6b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 08:48:27 -0400 Subject: [PATCH 08/19] copying missing file --- tests/run_appveyor.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/run_appveyor.bat b/tests/run_appveyor.bat index 57c18b91..214184fd 100644 --- a/tests/run_appveyor.bat +++ b/tests/run_appveyor.bat @@ -12,5 +12,6 @@ :: This file is run by the appveyor builds. :: +copy tests\example_config copy\tests\config %PYTHON%\Scripts\pip install -r tests/ci_requirements.txt %PYTHON%\Scripts\nosetests.exe -v From 3e6c2ef90c08b3da45423eb49cd46496dff4b7bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 08:49:33 -0400 Subject: [PATCH 09/19] fixed destination path --- tests/run_appveyor.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run_appveyor.bat b/tests/run_appveyor.bat index 214184fd..3388f367 100644 --- a/tests/run_appveyor.bat +++ b/tests/run_appveyor.bat @@ -12,6 +12,6 @@ :: This file is run by the appveyor builds. :: -copy tests\example_config copy\tests\config +copy tests\example_config copy tests\config %PYTHON%\Scripts\pip install -r tests/ci_requirements.txt %PYTHON%\Scripts\nosetests.exe -v From 1723bd2f178caa32a1b0ae6d6cb401a15ef863fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 08:50:25 -0400 Subject: [PATCH 10/19] I need coffee --- tests/run_appveyor.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run_appveyor.bat b/tests/run_appveyor.bat index 3388f367..7b65b4c8 100644 --- a/tests/run_appveyor.bat +++ b/tests/run_appveyor.bat @@ -12,6 +12,6 @@ :: This file is run by the appveyor builds. :: -copy tests\example_config copy tests\config +copy tests\example_config tests\config %PYTHON%\Scripts\pip install -r tests/ci_requirements.txt %PYTHON%\Scripts\nosetests.exe -v From 887702e8d21f6b424430d6fec1483ea0ef1ff271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 08:55:28 -0400 Subject: [PATCH 11/19] custom project for appveyor build --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 29be3dd8..f7659eeb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,6 +24,7 @@ environment: SG_HUMAN_PASSWORD: secure: JAxEsOimGFFr0hYgCd6prUNEdTmUZinPU0516bHs4Jk= SG_SCRIPT_NAME: travis-ci + SG_PROJECT_NAME: SG unittest project for AppVeyor build: off From 531a35cc6555760aa7fd81bddcb9781155653796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 09:07:55 -0400 Subject: [PATCH 12/19] updating credentials --- appveyor.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f7659eeb..064c2be5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,14 +16,14 @@ environment: # To update these values, visit AppVeyor's site, click the user icon and scroll down to Encrypt Data. SG_SERVER_URL: - secure: 1klEyyzGkwq7KyTgI+9nqiqCNcdOXLVR/P8nXGgKu2kHj+DDCNNe2LNDLh2h0TIA - SG_API_KEY: - secure: jnC8/rvRGohDM6FA1zDX7RjRKGCHQLPVjC8xfURr4EeMgzpMnoQgL/qjNis47IfwEm4+dI2eN9fDjskfea+o4pTX1gt2rV1fe4qhAxGE4g4= - SG_HUMAN_LOGIN: travis-ci - SG_HUMAN_NAME: Travis CI + secure: 1klEyyzGkwq7KyTgI+9nqiqCNcdOXLVR/P8nXGgKu2kLke3ui81KhoAkckJqa9da + SG_HUMAN_LOGIN: appveyor + SG_HUMAN_NAME: App Veyor SG_HUMAN_PASSWORD: secure: JAxEsOimGFFr0hYgCd6prUNEdTmUZinPU0516bHs4Jk= - SG_SCRIPT_NAME: travis-ci + SG_SCRIPT_NAME: python-api-test + SG_API_KEY: + secure: jnC8/rvRGohDM6FA1zDX7RjRKGCHQLPVjC8xfURr4EeMgzpMnoQgL/qjNis47IfwEm4+dI2eN9fDjskfea+o4pTX1gt2rV1fe4qhAxGE4g4= SG_PROJECT_NAME: SG unittest project for AppVeyor build: off From 8a2c565bc60a5b2dc47527ea31660ad58a2eeb55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 09:38:37 -0400 Subject: [PATCH 13/19] Switching to new ci site. --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 064c2be5..bd71103b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,14 +16,14 @@ environment: # To update these values, visit AppVeyor's site, click the user icon and scroll down to Encrypt Data. SG_SERVER_URL: - secure: 1klEyyzGkwq7KyTgI+9nqiqCNcdOXLVR/P8nXGgKu2kLke3ui81KhoAkckJqa9da + secure: lIYAxmyz5GEvnbxqE1pAoNuU5+04RYsSzfjRxjqV7vI= SG_HUMAN_LOGIN: appveyor SG_HUMAN_NAME: App Veyor SG_HUMAN_PASSWORD: - secure: JAxEsOimGFFr0hYgCd6prUNEdTmUZinPU0516bHs4Jk= + secure: 0/BofzMkXtzwtRqzC94FHt3lcyMBG0rr2w0rUropeT4= SG_SCRIPT_NAME: python-api-test SG_API_KEY: - secure: jnC8/rvRGohDM6FA1zDX7RjRKGCHQLPVjC8xfURr4EeMgzpMnoQgL/qjNis47IfwEm4+dI2eN9fDjskfea+o4pTX1gt2rV1fe4qhAxGE4g4= + secure: cTW+pBjl1H17hsjDOvLaspqkc3H9juXfOhoXMvdcA2l3b5FQeJVYUBWaJUxmqTw9gEzAHmUS6R4WVvw07IWOQ9on8UFHsHqv3JkL2Ji/Oeo= SG_PROJECT_NAME: SG unittest project for AppVeyor build: off From e18da65acc93eacc1e5bd743f20fe4167fe499c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 10:14:12 -0400 Subject: [PATCH 14/19] do not assume order of summarized results. --- tests/test_api.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_api.py b/tests/test_api.py index a6bd6aa5..ca235f7d 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -560,7 +560,14 @@ def test_summary_values(self): self.sg.batch(batch_data) self.assertEqual(result['summaries'], count) - self.assertEqual(result['groups'], groups) + # Do not assume the order of the summarized results. + self.assertEqual( + sorted( + result['groups'], + key=lambda x: x["group_name"] + ), + groups + ) def test_ensure_ascii(self): '''test_ensure_ascii tests ensure_unicode flag.''' From 566923258f875dcd3663a0b6fd51b2ea05903313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 10:25:11 -0400 Subject: [PATCH 15/19] fixing flake8. --- .flake8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index 0b1bc5a5..bbe740df 100644 --- a/.flake8 +++ b/.flake8 @@ -35,8 +35,8 @@ exclude = *.egg-info, __pycache__, # Those are our third parties, do not lint them! - shotgun_api3/lib/httplib2/*.py - shotgun_api3/lib/simplejson/*.py + shotgun_api3/lib/httplib2/*.py, + shotgun_api3/lib/simplejson/*.py, shotgun_api3/lib/xmlrpclib.py # exceptions From da5ac311806e21bcc8848720d968c5de19d4707a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 11:06:55 -0400 Subject: [PATCH 16/19] enabling coverage --- .coveragerc | 23 ++++++++++++++++++++--- .travis.yml | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.coveragerc b/.coveragerc index 3e35ad8a..5878223d 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,3 +1,20 @@ -[report] -source = shotgun_api3 -omit = shotgun_api3/lib/* +# Copyright (c) 2018 Shotgun Software Inc. +# +# CONFIDENTIAL AND PROPRIETARY +# +# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit +# Source Code License included in this distribution package. See LICENSE. +# By accessing, using, copying or modifying this work you indicate your +# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights +# not expressly granted therein are reserved by Shotgun Software Inc. +# +# coverage configuration - used by https://coveralls.io/ integration +# +# + +[run] +source=shotgun_api3 +omit= + shotgun_api3/lib/httplib2/* + shotgun_api3/lib/simplejson/* + shotgun_api3/lib/xmlrpclib.py diff --git a/.travis.yml b/.travis.yml index 84f5c739..2e4a9189 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ install: before_script: - cp ./tests/example_config ./tests/config # command to run tests -script: COVERAGE=1 nosetests -v +script: nosetests --with-coverage -v after_success: coveralls notifications: email: From 225916a51014f26ffc2e07e21c1dfea44351f3fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 11:19:19 -0400 Subject: [PATCH 17/19] switched how tests are invoked for cleaner coverage report. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2e4a9189..d8bfa73f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ install: before_script: - cp ./tests/example_config ./tests/config # command to run tests -script: nosetests --with-coverage -v +script: coverage run -m nose after_success: coveralls notifications: email: From 4dfde1670e8bd359a67857b75a9ddf72aab05c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 11:37:05 -0400 Subject: [PATCH 18/19] makes sure user account is not locked after invalid credentials --- tests/test_api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_api.py b/tests/test_api.py index ca235f7d..e83674d4 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1595,6 +1595,10 @@ def test_bad_auth(self): sg = shotgun_api3.Shotgun(server_url, login=login, password='not a real password') self.assertRaises(shotgun_api3.AuthenticationFault, sg.find_one, 'Shot',[]) + # This may trigger an account lockdown. Make sure it is not locked anymore. + user = self.sg.find_one("HumanUser", [["login", "is", login]]) + self.sg.update("HumanUser", user["id"], {"locked_until": None}) + @patch('shotgun_api3.shotgun.Http.request') def test_status_not_200(self, mock_request): response = MagicMock(name="response mock", spec=dict) From b38e1857aa1c3d3b07a79695d867c212f4a7fb69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Boismenu?= Date: Thu, 5 Apr 2018 11:53:10 -0400 Subject: [PATCH 19/19] triggering build on travis to pick up new settings.