ksallberg / iexcloud

BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Adapt tests #1

Open joshua-morris opened 5 years ago

joshua-morris commented 5 years ago

Adapt the tests to use the sandbox API key.

madjestic commented 4 years ago

Can't a compiler pragma be used to set baseURL = sandboxURL when compiled with a debug flag for example?

For example it could be something like: change in proj.cabal:

...
--cpp-options:         -DSANDBOX
...

and in the Stocks.hs we do:

#ifdef SANDBOX
baseURL = sandboxURL
#endif

There's probably more than 1 way to fix #1. What do you have in mind how to approach it?

Cheers, Vlad

ksallberg commented 4 years ago

I tried to do what you describe here, but I didn't succeed and have no more time this weekend. Basically when i run "stack test" with default=True on the flag, the system still does not call the sandbox URL.

https://github.com/ksallberg/iexcloud/commit/688eed3ae3fb5d22918b12a28c0ca7c7b2f4814a

If you want you could help me out if you see what is wrong. Also I think this change would conflict with the relaxation of dependencies that you proposed.

Another approach could be to require the user to specify the URL they want to use in each API call. But that would put more burden on the user of this code.