codeforkansascity / meep-backend

MIT License
8 stars 11 forks source link

Add csv upload #45

Closed t-ketchem closed 5 years ago

t-ketchem commented 5 years ago

adds uploads endpoint that can take csv files as input and update the projects database. The basics are working for me when running everything through docker. I'm using curl through a windows command prompt like so: curl -X POST -F file=@"(add full folder path here)\meep-backend\files\projectsSampleCSV.csv" http://localhost:8001/uploads

evanharmon1 commented 5 years ago

I went ahead and pushed a commit to this branch to show an example of one of the ways of getting that test to pass since @t-ketchem was asking for some help working with tests. I will try to do what I can to add more api tests and maybe write some scripts to run them more easily like @galbwe suggested. Until then, you can run the upload test like Wes mentioned above. Another way is to shell into the api container and run whichever tests you want that way. E.g.: docker container exec -it meep-backend_api_1 /bin/ash and then cd to the test's directory and run it: `pytest test_projects.py. You can also run them with the -v option to get more details on the tests. I know that sometimes the tests don't pass since we aren't using a separate test database that gets setup and torn down properly. I will see if I can make any progress on that. Does that answer all of your questions Tyler? Let me know if you have any other questions.

galbwe commented 5 years ago

I threw in the small changes I suggested, and did some cleanup with imports and code formatting. Merging.