Skip to content

Commit

Permalink
Improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed May 17, 2021
1 parent e6139ce commit ed2706f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def test_init(self):
def test_setup(self):
headers = YTMusic.setup(config['auth']['headers_file'], config['auth']['headers_raw'])
self.assertGreaterEqual(len(headers), 2)
with unittest.mock.patch('builtins.input', return_value=config['auth']['headers_raw']):
headers_raw = config['auth']['headers_raw'].split('\n')
with unittest.mock.patch('builtins.input', side_effect=(headers_raw + [EOFError()])):
headers = YTMusic.setup(config['auth']['headers_file'])
self.assertGreaterEqual(len(headers), 2)

###############
Expand Down Expand Up @@ -306,7 +308,7 @@ def test_end2end(self):
###############

def test_get_library_upload_songs(self):
results = self.yt_auth.get_library_upload_songs(50)
results = self.yt_auth.get_library_upload_songs(50, order='z_to_a')
self.assertGreater(len(results), 25)

@unittest.skip("Must not have any uploaded songs to pass")
Expand All @@ -315,7 +317,7 @@ def test_get_library_upload_songs_empty(self):
self.assertEquals(len(results), 0)

def test_get_library_upload_albums(self):
results = self.yt_auth.get_library_upload_albums(50)
results = self.yt_auth.get_library_upload_albums(50, order='a_to_z')
self.assertGreater(len(results), 40)

@unittest.skip("Must not have any uploaded albums to pass")
Expand Down

0 comments on commit ed2706f

Please sign in to comment.