| Conditions | 1 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | import unittest |
||
| 13 | @httpretty.activate |
||
| 14 | def test_get_cover_parse_result(self): |
||
| 15 | # OK Computer response |
||
| 16 | httpretty.register_uri(httpretty.GET, |
||
| 17 | "https://itunes.apple.com/search/?limit=1&entity=musicArtist%2CmusicTrack%2Calbum%2Cmix%2Csong&term=OK+Computer&media=music", |
||
| 18 | body=open(self.ok_computer).read(), |
||
| 19 | content_type="application/json") |
||
| 20 | |||
| 21 | # Request the content from the mock |
||
| 22 | result = self.coverpy.get_cover("OK Computer") |
||
| 23 | |||
| 24 | # Begin assertions |
||
| 25 | self.assertEquals(result.name, "OK Computer") |
||
| 26 | self.assertEquals(result.type, "album") |
||
| 27 | |||
| 41 | unittest.main() |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.