Add more tests
This commit is contained in:
parent
74fc9fd470
commit
6f543999d1
6 changed files with 29 additions and 13 deletions
|
|
@ -9,13 +9,13 @@
|
|||
</mask>
|
||||
<g mask="url(#a)">
|
||||
<path fill="#555" d="M0 0h63v20H0z"/>
|
||||
<path fill="#97CA00" d="M63 0h36v20H63z"/>
|
||||
<path fill="#4c1" d="M63 0h36v20H63z"/>
|
||||
<path fill="url(#b)" d="M0 0h99v20H0z"/>
|
||||
</g>
|
||||
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
||||
<text x="31.5" y="15" fill="#010101" fill-opacity=".3">coverage</text>
|
||||
<text x="31.5" y="14">coverage</text>
|
||||
<text x="80" y="15" fill="#010101" fill-opacity=".3">93%</text>
|
||||
<text x="80" y="14">93%</text>
|
||||
<text x="80" y="15" fill="#010101" fill-opacity=".3">96%</text>
|
||||
<text x="80" y="14">96%</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 904 B After Width: | Height: | Size: 901 B |
|
|
@ -11,6 +11,9 @@ youtube_brand = YTMusic(config['auth']['headers'], config['auth']['brand_account
|
|||
|
||||
|
||||
class TestYTMusic(unittest.TestCase):
|
||||
def test_init(self):
|
||||
self.assertRaises(Exception, YTMusic, "{}")
|
||||
|
||||
def test_setup(self):
|
||||
YTMusic.setup(config['auth']['headers_file'])
|
||||
|
||||
|
|
@ -19,13 +22,19 @@ class TestYTMusic(unittest.TestCase):
|
|||
###############
|
||||
|
||||
def test_search(self):
|
||||
results = youtube_auth.search("Oasis Wonderwall")
|
||||
query = "Oasis Wonderwall"
|
||||
self.assertRaises(Exception, youtube_auth.search, query, "song")
|
||||
results = youtube_auth.search(query)
|
||||
self.assertGreater(len(results), 0)
|
||||
results = youtube_auth.search("Oasis Wonderwall", 'videos')
|
||||
results = youtube_auth.search(query, 'songs')
|
||||
self.assertGreater(len(results), 0)
|
||||
results = youtube_auth.search("Oasis Wonderwall", 'albums')
|
||||
results = youtube_auth.search(query, 'videos')
|
||||
self.assertGreater(len(results), 0)
|
||||
results = youtube_auth.search("Oasis Wonderwall", 'artists')
|
||||
results = youtube_auth.search(query, 'albums')
|
||||
self.assertGreater(len(results), 0)
|
||||
results = youtube_auth.search(query, 'artists')
|
||||
self.assertGreater(len(results), 0)
|
||||
results = youtube_auth.search(query, 'playlists')
|
||||
self.assertGreater(len(results), 0)
|
||||
|
||||
def test_get_artist(self):
|
||||
|
|
@ -162,6 +171,7 @@ class TestYTMusic(unittest.TestCase):
|
|||
self.assertGreater(len(results), 25)
|
||||
|
||||
def test_upload_song(self):
|
||||
self.assertRaises(Exception, youtube_auth.upload_song, 'song.wav')
|
||||
response = youtube_auth.upload_song(config['uploads']['file'])
|
||||
self.assertEqual(response.status_code, 409)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue