MagicTheGathering / mtg-sdk-python

Magic: The Gathering SDK - Python
MIT License
262 stars 45 forks source link

adding iterator to the Card class #31

Closed lmccartney closed 4 years ago

lmccartney commented 5 years ago

This pull request adds an iter() method to go along with the all() method on the Card class. This should allow users who need to interact with all cards to do so in a more efficient manner.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.07%) to 94.928% when pulling 8c5c97c1cf7386cb5f86c0a0b5e684b983d786c6 on lmccartney:adding-iterator-to-card into d9d12312bc8083a850585ce269822fe881cd5163 on MagicTheGathering:master.

lmccartney commented 5 years ago

the Card.all() method is not covered by the testing suite which coveralls doesn't like. Card.all() instanciates all cards into a list though, so it's not a very practical method to test. Also, it's effectively a wrapper around the iter() method so it not being tested seems acceptable. This PR also has nothing to do with that method other than being in the same file.

lmccartney commented 5 years ago

FWIW, just wrote a test to test .all() and it took 18 minutes to complete locally. vcr meant that repeat tests only took 25s, however that's still quite substantial.

adback03 commented 5 years ago

Sorry for the delay, I should have time to look at this in the next couple days!

lmccartney commented 5 years ago

Any update here?

If there is room, I'd be interested in helping maintain this code base.