erkghlerngm44 / malaffinity

Archived. Visit `erkghlerngm44/aniffinity` for new package.
https://github.com/erkghlerngm44/aniffinity
MIT License
1 stars 0 forks source link

Add `comparison` function #6

Closed erkghlerngm44 closed 7 years ago

erkghlerngm44 commented 7 years ago

Let's see what Codecov's fancy pull request comments look like.

TODO:

codecov[bot] commented 7 years ago

Codecov Report

Merging #6 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #6   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           7      7           
  Lines         106    110    +4     
=====================================
+ Hits          106    110    +4
Impacted Files Coverage Δ
malaffinity/__init__.py 100% <ø> (ø) :arrow_up:
malaffinity/malaffinity.py 100% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ff0288e...ceb654b. Read the comment docs.

erkghlerngm44 commented 7 years ago

E: I can't be bothered.

Ugh

The calculate_affinity function is used in the test_affinity__with_self test, because I didn't want to initialise a class and all that. There isn't actually a test for it.

I don't think there's a way to test the comparison and calculate_affinity functions properly without creating a second MAL account for it. malaffinity.endpoints.myanimelist can't be swapped out halfway through running the functions, so we can't use the DUMMY_LIST for it.

Hmmm... Could try to write another mock function, that'll return different things based on the username passed to it. If it gets testmalacct0000, then return its list. If it gets another, then return the DUMMY_LIST. That could easily be placed in from the start.

The question is how one can go about retrieving a list off MAL, if the endpoint for doing so is replaced with the thing that wants to call it...

erkghlerngm44 commented 7 years ago

This all needs tidying up, but I really can't be bothered. ¯\_(ツ)_/¯