Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Unit Tests for each Symbol & Feed Handle Point #35

Open
2 of 10 tasks
jnmclarty opened this issue May 25, 2015 · 2 comments
Open
2 of 10 tasks

Create Unit Tests for each Symbol & Feed Handle Point #35

jnmclarty opened this issue May 25, 2015 · 2 comments

Comments

@jnmclarty
Copy link
Member

Symbol

  • caching
  • concatenation (of feeds)
  • aggregation (of final value column)
  • validity_check

Feed

  • api_failure
  • empty_feed
  • index_type_problem
  • index_property_problem
  • data_type_problem
  • monounique
@jnmclarty jnmclarty added this to the 0.0.3 milestone May 25, 2015
@jnmclarty
Copy link
Member Author

@Asiant (or anybody interested in tackling this issue)

Trump's caching process takes responses from a range of sources for data. Handling all the edge cases, would be too extensive from Trump to do, so instead, if there's a problem at certain points in the process, the handle point decides what to do with certain kinds of problems - depending on settings in the Symbol/Feed's Handle settings ( RAISE / WARN / LOG / E-MAIL / etc.)

So, for instance, let's assume we have symbol with just one feed. The feed is set up, to source data from a database table somewhere. But, through something unrelated to Trump, the table is dropped, or even renamed. When Trump tries to cache the data, there would be an api_failure.

Now, admittedly, it wouldn't make sense to only warn, on an api_failure, for a symbol with only one feed - because everything downstream would fail. (Eg. it couldn't handle index-type conversion) But, if there were two or more, maybe if one feed is down, it's okay to proceed, because the back-up feed will work.

To create tests for each, one will have to make error cases.

The EASIEST one to start on would be the api_failure. You could duplicate (copy/paste) one of the tests which relies on a CSV source file (ctrl-f "csv" in test_orm.py ), and make a copy of the CSV data file that the test uses. Change the contents of the new CSV file, so that it fails to get data from it. Maybe delete the column of data it's looking for, for instance. As soon as trump tries to fetch it, you'll have the api_failure case done. One would need to catch the exception, and check the message somehow, to make sure that the test properly tests the failure (and not some other failure).

@jnmclarty
Copy link
Member Author

#61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant