Skip to content

Commit

Permalink
Replace deprecated assertEquals with assertEqual.
Browse files Browse the repository at this point in the history
  • Loading branch information
brunal committed Apr 1, 2015
1 parent bad87c1 commit 5e26d48
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
30 changes: 15 additions & 15 deletions test/test_importer.py
Expand Up @@ -1462,51 +1462,51 @@ def _normalize_path(self, path):
def test_coalesce_nested_album_multiple_subdirs(self):
self.create_music()
albums = list(albums_in_dir(self.base))
self.assertEquals(len(albums), 4)
self.assertEqual(len(albums), 4)
root, items = albums[0]
self.assertEquals(root, self.dirs[0:3])
self.assertEquals(len(items), 3)
self.assertEqual(root, self.dirs[0:3])
self.assertEqual(len(items), 3)

def test_coalesce_nested_album_single_subdir(self):
self.create_music()
albums = list(albums_in_dir(self.base))
root, items = albums[1]
self.assertEquals(root, self.dirs[3:5])
self.assertEquals(len(items), 1)
self.assertEqual(root, self.dirs[3:5])
self.assertEqual(len(items), 1)

def test_coalesce_flattened_album_case_typo(self):
self.create_music()
albums = list(albums_in_dir(self.base))
root, items = albums[2]
self.assertEquals(root, self.dirs[6:8])
self.assertEquals(len(items), 2)
self.assertEqual(root, self.dirs[6:8])
self.assertEqual(len(items), 2)

def test_single_disc_album(self):
self.create_music()
albums = list(albums_in_dir(self.base))
root, items = albums[3]
self.assertEquals(root, self.dirs[8:])
self.assertEquals(len(items), 1)
self.assertEqual(root, self.dirs[8:])
self.assertEqual(len(items), 1)

def test_do_not_yield_empty_album(self):
self.create_music(files=False)
albums = list(albums_in_dir(self.base))
self.assertEquals(len(albums), 0)
self.assertEqual(len(albums), 0)

def test_single_disc_unicode(self):
self.create_music(ascii=False)
albums = list(albums_in_dir(self.base))
root, items = albums[3]
self.assertEquals(root, self.dirs[8:])
self.assertEquals(len(items), 1)
self.assertEqual(root, self.dirs[8:])
self.assertEqual(len(items), 1)

def test_coalesce_multiple_unicode(self):
self.create_music(ascii=False)
albums = list(albums_in_dir(self.base))
self.assertEquals(len(albums), 4)
self.assertEqual(len(albums), 4)
root, items = albums[0]
self.assertEquals(root, self.dirs[0:3])
self.assertEquals(len(items), 3)
self.assertEqual(root, self.dirs[0:3])
self.assertEqual(len(items), 3)


class ReimportTest(unittest.TestCase, ImportHelper):
Expand Down
14 changes: 7 additions & 7 deletions test/test_spotify.py
Expand Up @@ -73,14 +73,14 @@ def test_missing_request(self):
length=10
)
item.add(self.lib)
self.assertEquals([], self.spotify.query_spotify(self.lib, ""))
self.assertEqual([], self.spotify.query_spotify(self.lib, ""))

params = _params(responses.calls[0].request.url)
self.assertEquals(
self.assertEqual(
params['q'],
['duifhjslkef album:lkajsdflakjsd artist:ujydfsuihse'],
)
self.assertEquals(params['type'], ['track'])
self.assertEqual(params['type'], ['track'])

@responses.activate
def test_track_request(self):
Expand Down Expand Up @@ -192,16 +192,16 @@ def test_track_request(self):
)
item.add(self.lib)
results = self.spotify.query_spotify(self.lib, "Happy")
self.assertEquals(1, len(results))
self.assertEquals("6NPVjNh8Jhru9xOmyQigds", results[0]['id'])
self.assertEqual(1, len(results))
self.assertEqual("6NPVjNh8Jhru9xOmyQigds", results[0]['id'])
self.spotify.output_results(results)

params = _params(responses.calls[0].request.url)
self.assertEquals(
self.assertEqual(
params['q'],
['Happy album:Despicable Me 2 artist:Pharrell Williams'],
)
self.assertEquals(params['type'], ['track'])
self.assertEqual(params['type'], ['track'])


def suite():
Expand Down
4 changes: 2 additions & 2 deletions test/test_util.py
Expand Up @@ -113,8 +113,8 @@ def popen_fail(*args, **kwargs):
mock_popen.side_effect = popen_fail
with self.assertRaises(subprocess.CalledProcessError) as exc_context:
util.command_output([b"taga", b"\xc3\xa9"])
self.assertEquals(exc_context.exception.returncode, 1)
self.assertEquals(exc_context.exception.cmd, b"taga \xc3\xa9")
self.assertEqual(exc_context.exception.returncode, 1)
self.assertEqual(exc_context.exception.cmd, b"taga \xc3\xa9")


class PathConversionTest(_common.TestCase):
Expand Down

0 comments on commit 5e26d48

Please sign in to comment.