qri-io / walk

Webcrawler/sitemapper
GNU General Public License v3.0
6 stars 2 forks source link

Test that file actually got written in TestCBORResourceFileWriter #18

Open Mr0grog opened 5 years ago

Mr0grog commented 5 years ago

In lib/resource_handler_test.go, TestCBORResourceFileWriter exercises the file writer, but doesn’t actually verify that it wrote the correct file to disk:

https://github.com/qri-io/walk/blob/8ff3080b27d1b3bc8b7560e31ebcdfc98add6bae/lib/resource_handler_test.go#L28-L33

We should probably use os.Stat() or traverse the files in the directory after each of those rh.HandleResource(r) calls to verify that the right file either did or did not get written.