opensearch-project / demos

Apache License 2.0
2 stars 13 forks source link

[FEATURE] Add test for #36 #39

Closed dtaivpp closed 11 months ago

dtaivpp commented 1 year ago

Is your feature request related to a problem?

We added the ability to read from the data directory in #36

What solution would you like?

We need to add a related test to ensure that we have test coverage for it. The tests should ensure that if the directory is empty the appropriate directory is returned.

LucasWang750 commented 12 months ago

Can I please take this issue.

dtaivpp commented 12 months ago

@LucasWang750 here is how I would probably recommend going about testing this.

  1. Change the original function to take in a path with the default value set to the environment variable we created.
  2. Then you can test that the function returns data in the correct format (eg, isinstance(returned data, dict))
  3. Then we can create assertions when we pass in an empty directory (/dev/null on linux/unix systems should work) that the appropriate error is raised
dtaivpp commented 11 months ago

Closed with #47