aazuspan / eerepr

Interactive Code Editor-style reprs for Earth Engine objects in a Jupyter notebook
MIT License
32 stars 0 forks source link

Test HTML reprs with cached JSON data #19 #22

Closed aazuspan closed 1 year ago

aazuspan commented 1 year ago

This would close #19.

Rather than always testing against server data pulled from Earth Engine, tests now run against locally cached JSON objects if they exist. If not, they are downloaded and added to the cache, using the serialized object as the key to ensure objects are unique in the cache. This means that new tests can be written with new objects without having to manually store new data.

In the unlikely event that breaking changes are made to how Earth Engine represents objects, the cache would need to be manually deleted and re-downloaded.

For reference, after the first run, this decreased the total test time from ~22 seconds to ~2 seconds.