moltin / python-sdk

Moltin python SDK
MIT License
6 stars 9 forks source link

don't call .capitalize on the endpoint class name #10

Closed mikeyhew closed 6 years ago

mikeyhew commented 8 years ago

This way the product endpoint is only available via the name supplied in the endpoints attribute:

m = Moltin(client_id, client_secret)
m.Product
# <moltin.moltin.Product object at 0x1026651d0>
m.pRoduct
# before this PR:  <moltin.moltin.Product object at 0x10245cb70>
# after: RuntimeError: No such API object: pRoduct

This also will remove the problem that you will run into if you ever add an endpoint with a multi_word name, because 'MutliWord'.capitalize returns 'Multiword'

mikeyhew commented 6 years ago

Closing this PR since it's gotten pretty stale and doesn't seem like there's interest