From 0652e407f3d34a255e45872f7ec94368deb9c54e Mon Sep 17 00:00:00 2001 From: kellender Date: Tue, 23 Jun 2015 08:10:56 -0400 Subject: [PATCH 1/6] Yml and badge files --- .travis.yml | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 3 +++ appveyor.yml | 19 ++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 .travis.yml create mode 100644 README.md create mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..3f3eec4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,72 @@ +# This file describes the combination of the different build configurations for seattle testbed +# We create a matrix of machines with software configurations +matrix: + include: + # Here we are using objective-c as currently there is no MAC + PYTHON combination available + # We use objective-c to install python version required for us + # Below are combinations for MAC instances + # Below we are installing python 2.5.6 on MAC + - language: objective-c + os: osx + install: + - if [[ "$(uname -s)" == 'Darwin' ]]; then + pyenv install 2.5.6; + pyenv global 2.5.6; + fi + - export PYENV_ROOT="${HOME}/.pyenv" + - if [ -d "${PYENV_ROOT}" ]; then + export PATH="${PYENV_ROOT}/bin:${PATH}"; + eval "$(pyenv init -)"; + fi + + # Below we are installing python 2.6.9 on MAC + - language: objective-c + os: osx + install: + - if [[ "$(uname -s)" == 'Darwin' ]]; then + pyenv install 2.6.9; + pyenv global 2.6.9; + fi + - export PYENV_ROOT="${HOME}/.pyenv" + - if [ -d "${PYENV_ROOT}" ]; then + export PATH="${PYENV_ROOT}/bin:${PATH}"; + eval "$(pyenv init -)"; + fi + # Below we are installing python 2.7.9 on MAC + - language: objective-c + os: osx + install: + - if [[ "$(uname -s)" == 'Darwin' ]]; then + brew update; + brew install python; + fi + # The below are configurations for Linux instances + # Python 2.5 on Linux + - language: perl + python: '2.5' + os: linux + install: + - export DEBIAN_FRONTEND=noninteractive + - sudo apt-add-repository -y ppa:fkrull/deadsnakes + - sudo apt-get update + - sudo apt-get -y install python2.5 + - sudo ln -sf /usr/bin/python2.5 /usr/bin/python + - sudo ln -sf /usr/bin/python2.5 /usr/bin/python2 + - sudo ln -sf /usr/bin/pydoc2.5 /usr/bin/pydoc + - sudo ln -sf /usr/bin/pygettext2.5 /usr/bin/pygettext + # Python 2.6 on Linux + - language: python + python: '2.6' + os: linux + # Python 2.7 on Linux + - language: python + python: '2.7' + os: linux + +script: + - python --version + - cd ./scripts + - python initialize.py + - python build.py -t + - cd ../RUNNABLE + - python utf.py -a diff --git a/README.md b/README.md new file mode 100644 index 0000000..f65b0d2 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +Linux: [![Build Status](https://travis-ci.org/kellender/seattlelib_v2.svg?branch=continuous_integration_testing)](https://travis-ci.org/kellender/seattlelib_v2) +
+Windows: [![Build status](https://ci.appveyor.com/api/projects/status/67g61fiq038upa6q?svg=true)](https://ci.appveyor.com/project/kellender/seattlelib-v2) diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..b37f645 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,19 @@ +build: false + +os: Unstable + +environment: + matrix: + - PYTHON: "C:/Python26" + - PYTHON: "C:/Python27" + +platform: +- x86 +- x64 + +test_script: + - cd scripts + - python initialize.py + - python build.py -t + - cd ../RUNNABLE + - python utf.py -a From 5c6f9d59883c60a624ecd0d3a9d4182133514ded Mon Sep 17 00:00:00 2001 From: Ajay Shenoy Date: Tue, 23 Jun 2015 08:18:02 -0400 Subject: [PATCH 2/6] Delete .travis.yml --- .travis.yml | 72 ----------------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3f3eec4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,72 +0,0 @@ -# This file describes the combination of the different build configurations for seattle testbed -# We create a matrix of machines with software configurations -matrix: - include: - # Here we are using objective-c as currently there is no MAC + PYTHON combination available - # We use objective-c to install python version required for us - # Below are combinations for MAC instances - # Below we are installing python 2.5.6 on MAC - - language: objective-c - os: osx - install: - - if [[ "$(uname -s)" == 'Darwin' ]]; then - pyenv install 2.5.6; - pyenv global 2.5.6; - fi - - export PYENV_ROOT="${HOME}/.pyenv" - - if [ -d "${PYENV_ROOT}" ]; then - export PATH="${PYENV_ROOT}/bin:${PATH}"; - eval "$(pyenv init -)"; - fi - - # Below we are installing python 2.6.9 on MAC - - language: objective-c - os: osx - install: - - if [[ "$(uname -s)" == 'Darwin' ]]; then - pyenv install 2.6.9; - pyenv global 2.6.9; - fi - - export PYENV_ROOT="${HOME}/.pyenv" - - if [ -d "${PYENV_ROOT}" ]; then - export PATH="${PYENV_ROOT}/bin:${PATH}"; - eval "$(pyenv init -)"; - fi - # Below we are installing python 2.7.9 on MAC - - language: objective-c - os: osx - install: - - if [[ "$(uname -s)" == 'Darwin' ]]; then - brew update; - brew install python; - fi - # The below are configurations for Linux instances - # Python 2.5 on Linux - - language: perl - python: '2.5' - os: linux - install: - - export DEBIAN_FRONTEND=noninteractive - - sudo apt-add-repository -y ppa:fkrull/deadsnakes - - sudo apt-get update - - sudo apt-get -y install python2.5 - - sudo ln -sf /usr/bin/python2.5 /usr/bin/python - - sudo ln -sf /usr/bin/python2.5 /usr/bin/python2 - - sudo ln -sf /usr/bin/pydoc2.5 /usr/bin/pydoc - - sudo ln -sf /usr/bin/pygettext2.5 /usr/bin/pygettext - # Python 2.6 on Linux - - language: python - python: '2.6' - os: linux - # Python 2.7 on Linux - - language: python - python: '2.7' - os: linux - -script: - - python --version - - cd ./scripts - - python initialize.py - - python build.py -t - - cd ../RUNNABLE - - python utf.py -a From 21502cddce14afe39b90f404b9d7ea2aeea5fe1e Mon Sep 17 00:00:00 2001 From: Ajay Shenoy Date: Tue, 23 Jun 2015 08:18:13 -0400 Subject: [PATCH 3/6] Delete README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index f65b0d2..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Linux: [![Build Status](https://travis-ci.org/kellender/seattlelib_v2.svg?branch=continuous_integration_testing)](https://travis-ci.org/kellender/seattlelib_v2) -
-Windows: [![Build status](https://ci.appveyor.com/api/projects/status/67g61fiq038upa6q?svg=true)](https://ci.appveyor.com/project/kellender/seattlelib-v2) From d205b58c5b71349768b406d781c5a06479abacdf Mon Sep 17 00:00:00 2001 From: Ajay Shenoy Date: Tue, 23 Jun 2015 08:18:26 -0400 Subject: [PATCH 4/6] Delete appveyor.yml --- appveyor.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index b37f645..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,19 +0,0 @@ -build: false - -os: Unstable - -environment: - matrix: - - PYTHON: "C:/Python26" - - PYTHON: "C:/Python27" - -platform: -- x86 -- x64 - -test_script: - - cd scripts - - python initialize.py - - python build.py -t - - cd ../RUNNABLE - - python utf.py -a From 4f8831afc9537546427a74fb245a45b074822046 Mon Sep 17 00:00:00 2001 From: kellender Date: Thu, 10 Sep 2015 11:51:54 -0400 Subject: [PATCH 5/6] added repyportability --- tests/ut_seattlelib_httpretrieve_content.py | 3 +++ tests/ut_seattlelib_httpretrieve_content_timeout.py | 2 ++ tests/ut_seattlelib_httpretrieve_filelikeobj_closed.py | 3 ++- tests/ut_seattlelib_httpretrieve_header_timeout.py | 3 ++- tests/ut_seattlelib_httpretrieve_post.py | 2 ++ tests/ut_seattlelib_httpretrieve_read_done.py | 2 ++ tests/ut_seattlelib_httpretrieve_read_limit.py | 2 ++ tests/ut_seattlelib_httpretrieve_redirect_notgiven.py | 3 ++- 8 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/ut_seattlelib_httpretrieve_content.py b/tests/ut_seattlelib_httpretrieve_content.py index b38cfba..0f83355 100644 --- a/tests/ut_seattlelib_httpretrieve_content.py +++ b/tests/ut_seattlelib_httpretrieve_content.py @@ -5,6 +5,9 @@ # if it pass's the test +from repyportability import * +add_dy_support(locals()) + dy_import_module_symbols('httpretrieve.r2py') dy_import_module_symbols('registerhttpcallback.r2py') diff --git a/tests/ut_seattlelib_httpretrieve_content_timeout.py b/tests/ut_seattlelib_httpretrieve_content_timeout.py index 947eb8d..473e51a 100644 --- a/tests/ut_seattlelib_httpretrieve_content_timeout.py +++ b/tests/ut_seattlelib_httpretrieve_content_timeout.py @@ -4,6 +4,8 @@ # prints failed error msg if httpretrieve failes the test and excutes without printing # if the test passes +from repyportability import * +add_dy_support(locals()) dy_import_module_symbols('httpretrieve.r2py') diff --git a/tests/ut_seattlelib_httpretrieve_filelikeobj_closed.py b/tests/ut_seattlelib_httpretrieve_filelikeobj_closed.py index 929b31a..1550a70 100644 --- a/tests/ut_seattlelib_httpretrieve_filelikeobj_closed.py +++ b/tests/ut_seattlelib_httpretrieve_filelikeobj_closed.py @@ -4,7 +4,8 @@ # prints failed error msg if httpretrieve fails the test and excutes without printing # if the test pass's - +from repyportability import * +add_dy_support(locals()) dy_import_module_symbols('httpretrieve.r2py') dy_import_module_symbols('registerhttpcallback.r2py') diff --git a/tests/ut_seattlelib_httpretrieve_header_timeout.py b/tests/ut_seattlelib_httpretrieve_header_timeout.py index 53c8f84..fb0b578 100644 --- a/tests/ut_seattlelib_httpretrieve_header_timeout.py +++ b/tests/ut_seattlelib_httpretrieve_header_timeout.py @@ -2,7 +2,8 @@ # prints failed error msg if httpretrieve fails the test and excutes without printing # if the test pass's - +from repyportability import * +add_dy_support(locals()) dy_import_module_symbols('httpretrieve.r2py') dy_import_module_symbols('registerhttpcallback.r2py') diff --git a/tests/ut_seattlelib_httpretrieve_post.py b/tests/ut_seattlelib_httpretrieve_post.py index c36bd53..4cd459e 100644 --- a/tests/ut_seattlelib_httpretrieve_post.py +++ b/tests/ut_seattlelib_httpretrieve_post.py @@ -4,6 +4,8 @@ # prints failed error msg if httpretrieve failes the test and just excutes if the # test pass's the test +from repyportability import * +add_dy_support(locals()) dy_import_module_symbols('httpretrieve.r2py') dy_import_module_symbols('registerhttpcallback.r2py') diff --git a/tests/ut_seattlelib_httpretrieve_read_done.py b/tests/ut_seattlelib_httpretrieve_read_done.py index d292e3a..fc53b6d 100644 --- a/tests/ut_seattlelib_httpretrieve_read_done.py +++ b/tests/ut_seattlelib_httpretrieve_read_done.py @@ -5,6 +5,8 @@ # if the test pass's +from repyportability import * +add_dy_support(locals()) dy_import_module_symbols('httpretrieve.r2py') dy_import_module_symbols('registerhttpcallback.r2py') diff --git a/tests/ut_seattlelib_httpretrieve_read_limit.py b/tests/ut_seattlelib_httpretrieve_read_limit.py index 73718d3..3d84a6f 100644 --- a/tests/ut_seattlelib_httpretrieve_read_limit.py +++ b/tests/ut_seattlelib_httpretrieve_read_limit.py @@ -5,6 +5,8 @@ # if the test passes +from repyportability import * +add_dy_support(locals()) dy_import_module_symbols('httpretrieve.r2py') dy_import_module_symbols('registerhttpcallback.r2py') diff --git a/tests/ut_seattlelib_httpretrieve_redirect_notgiven.py b/tests/ut_seattlelib_httpretrieve_redirect_notgiven.py index cc92287..f44eac0 100644 --- a/tests/ut_seattlelib_httpretrieve_redirect_notgiven.py +++ b/tests/ut_seattlelib_httpretrieve_redirect_notgiven.py @@ -4,7 +4,8 @@ # prints failed error msg if httpretrieve failes the test and excutes without printing # if the test passes - +from repyportability import * +add_dy_support(locals()) dy_import_module_symbols('httpretrieve.r2py') From 57c6d97b80eef4ba6d9dd1a482a9daee34abb579 Mon Sep 17 00:00:00 2001 From: kellender Date: Thu, 10 Sep 2015 11:57:05 -0400 Subject: [PATCH 6/6] added http_hierarchy_eror.r2py This file originally had a repy extension, but because the Unit Tests requested r2py extension and there was no differences in repy_v1 and repy_v2 within the file I changed the extension --- http_hierarchy_error.r2py | 206 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 http_hierarchy_error.r2py diff --git a/http_hierarchy_error.r2py b/http_hierarchy_error.r2py new file mode 100644 index 0000000..9be15d1 --- /dev/null +++ b/http_hierarchy_error.r2py @@ -0,0 +1,206 @@ +""" + + http_hierarchy_error.repy + + + Oct 05, 2009 + + + Yafete Yemuru + + + provides a hierachy http error using status code including client and server errors + classes. +""" + + +''' +http hierarchy error exception classes + +-> HttpError + -> HttpRetrieveClientError + -> HttpUserInputError + -> HttpConnectionError + + -> HttpServerError + -> HttpResponseError + -> HttpHeaderError + -> HttpHeaderReceivingError + -> HttpHeaderFormatError + -> HttpContentError + -> HttpContentReceivingError + -> HttpContentLengthError + + -> HttpStatuscodeError + -> HttpError1xx + -> followed by all http status code error number HttpError(number) + + -> HttpError2xx + -> followed by all http status code error number HttpError(number) + + -> HttpError3xx + -> followed by all http status code error number HttpError(number) + + -> HttpError4xx + -> followed by all http status code error number HttpError(number) + + -> HttpError5xx + -> followed by all http status code error number HttpError(number) + +''' + +class HttpError(Exception): + pass + +# raises an exception for http client error +class HttpRetrieveClientError(HttpError):# extend HttpError + pass +class HttpUserInputError(HttpRetrieveClientError): + pass +class HttpConnectionError(HttpRetrieveClientError): + pass + + +# raises an exception for any http server failure +class HttpServerError(HttpError):# extend HttpError + pass +class HttpResponseError(HttpServerError): + pass +class HttpHeaderError(HttpResponseError): + pass +class HttpHeaderReceivingError(HttpHeaderError): + pass +class HttpHeaderFormatError(HttpHeaderError): + pass +class HttpContentError(HttpResponseError): + pass +class HttpContentReceivingError(HttpContentError): + pass +class HttpContentLengthError(HttpContentError): + pass + + +class HttpStatusCodeError(HttpError):# extend HttpError + pass +class HttpError1xx(HttpStatusCodeError): + pass +class HttpError100(HttpError1xx): + pass +class HttpError101(HttpError1xx): + pass +class HttpError102(HttpError1xx): + pass + + +class HttpError2xx(HttpStatusCodeError): + pass +class HttpError201(HttpError2xx): + pass +class HttpError202(HttpError2xx): + pass +class HttpError203(HttpError2xx): + pass +class HttpError204(HttpError2xx): + pass +class HttpError205(HttpError2xx): + pass +class HttpError206(HttpError2xx): + pass +class HttpError207(HttpError2xx): + pass +class HttpError226(HttpError2xx): + pass + + +class HttpError3xx(HttpStatusCodeError): + pass +class HttpError300(HttpError3xx): + pass +class HttpError301(HttpError3xx): + pass +class HttpError302(HttpError3xx): + pass +class HttpError303(HttpError3xx): + pass +class HttpError304(HttpError3xx): + pass +class HttpError305(HttpError3xx): + pass +class HttpError306(HttpError3xx): + pass +class HttpError307(HttpError3xx): + pass + + +class HttpError4xx(HttpStatusCodeError): + pass +class HttpError400(HttpError4xx): + pass +class HttpError401(HttpError4xx): + pass +class HttpError402(HttpError4xx): + pass +class HttpError403(HttpError4xx): + pass +class HttpError404(HttpError4xx): + pass +class HttpError405(HttpError4xx): + pass +class HttpError406(HttpError4xx): + pass +class HttpError407(HttpError4xx): + pass +class HttpError408(HttpError4xx): + pass +class HttpError409(HttpError4xx): + pass +class HttpError410(HttpError4xx): + pass +class HttpError411(HttpError4xx): + pass +class HttpError412(HttpError4xx): + pass +class HttpError413(HttpError4xx): + pass +class HttpError414(HttpError4xx): + pass +class HttpError415(HttpError4xx): + pass +class HttpError416(HttpError4xx): + pass +class HttpError417(HttpError4xx): + pass +class HttpError418(HttpError4xx): + pass +class HttpError422(HttpError4xx): + pass +class HttpError423(HttpError4xx): + pass +class HttpError424(HttpError4xx): + pass +class HttpError425(HttpError4xx): + pass +class HttpError426(HttpError4xx): + pass + + +class HttpError5xx(HttpStatusCodeError): + pass +class HttpError500(HttpError5xx): + pass +class HttpError501(HttpError5xx): + pass +class HttpError502(HttpError5xx): + pass +class HttpError503(HttpError5xx): + pass +class HttpError504(HttpError5xx): + pass +class HttpError505(HttpError5xx): + pass +class HttpError506(HttpError5xx): + pass +class HttpError507(HttpError5xx): + pass +class HttpError510(HttpError5xx): + pass