-
Notifications
You must be signed in to change notification settings - Fork 46
Testing against local files #96
Comments
I never even thought of this idea. What do you think would be a good way of pulling it off? |
The way that changes the least would probably be kwargs where, if a path is given for a particular file, it uses that instead of fetching it, like:
|
Hmm. Though there are different files depending on what "result collection" you are reaching for. Compare the state-level results (more commonly used for primaries like we have in this midterm) with the "top of the ticket" and "summary" stuff that is used for the presidential election and balance of power stuff in the Congress. I wonder if caching the files in the same file structure in a dot folder or in |
Yeah, if you could just supply a local folder path that would contain a structure mimicking the FTP root, that would also do the trick, e.g.:
Where that folder contains:
|
I like this feature request, but I doubt I'll have time to work on it until we get into work for the November elections. The reason is that on our end we store each data pull in a database, which is then served to our in-development maps and results pages, so we don't have to tax the AP system much as part of our iterations. So if anybody out there in Gitland wants to take a shot, please do. |
I'm thinking about this too. My idea is to just subclass the |
Something like that could probably work. |
Here's a working, but fairly limited, example of testing the parsing capabilities of the library by replacing the https://gist.github.com/ghing/9b7f8fa9bc66db31d600 To me this is simple enough to do that it doesn't warrant adding this feature to the core library. |
Is there a simple way I'm missing to test against local files instead of hitting the AP live each time? When they run their tests I typically save the raw files by minute so I can spot check later. I tried modifying the lib for that but in the end it was easier to just set up a dummy FTP server to serve the local files.
The text was updated successfully, but these errors were encountered: