Git Product home page Git Product logo

python-sdk's People

Contributors

aaeronn avatar acpmasquerade avatar sagarchalise avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sagarchalise

python-sdk's Issues

expected api request class

request_post
request_get
api_request_put
api_request_delete


class Api:
        def get_api_headers(is_anonymous):
                if is_anonymous():
                        headers = anonymous_headers()
                else:
                        if not authorized
                                uNauth excetpion
                        headers = auth_headers()

                return headers

        def put(url, data, is_anonymous=False):
                response = requests.put(api_endpoint + url, data=data, headers=self.get_api_headers(is_anonymous))
                return get_sdk_response(response)

        def put(url, data, is_anonymous):
                response = requests.put(url, data=data, headers=self.get_api_headers(is_anonymous))
                return get_sdk_response(response)

        def put(url, data, is_anonymous):
                response = requests.put(url, data=data, headers=self.get_api_headers(is_anonymous))
                return get_sdk_response(response)

        def put(url, data, is_anonymous):
                response = requests.put(url, data=data, headers=self.get_api_headers(is_anonymous))
                return get_sdk_response(response)


        def get_sdk_response(response)        :
                - exception handling
                - json decode

tests practices and standard

Please refer to some standard libraries like facebook sdk and similar and lets try to follow some of the test practices / exceptions handling those libraries have used.

python setup.py test yields error

Installed /tmp/easy_install-AfcQay/mock-2.0.0/pbr-1.9.1-py2.7.egg
Marker evaluation failed, see the following error.  For more information see: http://docs.openstack.org/developer/pbr/compatibility.html#evaluate-marker
ERROR:root:Error parsing
Traceback (most recent call last):
  File "/tmp/easy_install-AfcQay/mock-2.0.0/pbr-1.9.1-py2.7.egg/pbr/core.py", line 111, in pbr
    attrs = util.cfg_to_args(path, dist.script_args)
  File "/tmp/easy_install-AfcQay/mock-2.0.0/pbr-1.9.1-py2.7.egg/pbr/util.py", line 248, in cfg_to_args
    kwargs = setup_cfg_to_setup_kwargs(config, script_args)
  File "/tmp/easy_install-AfcQay/mock-2.0.0/pbr-1.9.1-py2.7.egg/pbr/util.py", line 431, in setup_cfg_to_setup_kwargs
    if pkg_resources.evaluate_marker('(%s)' % env_marker):
  File "//home/machine/.virtualenvs/picovico-python-sdk/local/lib/python2.7/site-packages/pkg_resources.py", line 1302, in evaluate_marker
    return cls.interpret(parser.expr(text).totuple(1)[1])
  File "//home/machine/.virtualenvs/picovico-python-sdk/local/lib/python2.7/site-packages/pkg_resources.py", line 1337, in interpret
    return op(nodelist)
  File "//home/machine/.virtualenvs/picovico-python-sdk/local/lib/python2.7/site-packages/pkg_resources.py", line 1250, in atom
    return cls.interpret(nodelist[2])
  File "//home/machine/.virtualenvs/picovico-python-sdk/local/lib/python2.7/site-packages/pkg_resources.py", line 1337, in interpret
    return op(nodelist)
  File "//home/machine/.virtualenvs/picovico-python-sdk/local/lib/python2.7/site-packages/pkg_resources.py", line 1271, in comparison
    raise SyntaxError(msg)
SyntaxError: '<' operator not allowed in environment markers
error: Setup script exited with error in setup command: Error parsing /tmp/easy_install-AfcQay/mock-2.0.0/setup.cfg: SyntaxError: '<' operator not allowed in environment markers

pip install picovico -successful but picovico-client throwing error

$ which picovico-client
$HOME/.virtualenvs/picovico-python-sdk-test/bin/picovico-client

$ picovico-client
from: can't read /var/mail/picovico.cli.argsparser
$HOME/.virtualenvs/picovico-python-sdk-test/bin/picovico-client: line 5: syntax error: unexpected end of file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.