From 2aa4dbdf880f971c9474b2abf78d8a6c0405d382 Mon Sep 17 00:00:00 2001 From: hugovk Date: Tue, 17 Oct 2017 21:57:17 +0300 Subject: [PATCH] Split Last.fm/Libre.fm tests --- tests/test_pylast.py | 25 +++---------------------- tests/test_pylast_librefm.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 22 deletions(-) create mode 100755 tests/test_pylast_librefm.py diff --git a/tests/test_pylast.py b/tests/test_pylast.py index 2342e02..7024067 100755 --- a/tests/test_pylast.py +++ b/tests/test_pylast.py @@ -2,12 +2,13 @@ """ Integration (not unit) tests for pylast.py """ -from flaky import flaky import os -import pytest import time import unittest +import pytest +from flaky import flaky + import pylast @@ -1395,25 +1396,5 @@ class TestPyLastUser(PyLastTestCase): self.assertEqual(mbid, None) -@flaky(max_runs=5, min_passes=1) -class TestPyLastWithLibreFm(unittest.TestCase): - """Own class for Libre.fm because we don't need the Last.fm setUp""" - - def test_libre_fm(self): - # Arrange - secrets = load_secrets() - username = secrets["username"] - password_hash = secrets["password_hash"] - - # Act - network = pylast.LibreFMNetwork( - password_hash=password_hash, username=username) - artist = network.get_artist("Radiohead") - name = artist.get_name() - - # Assert - self.assertEqual(name, "Radiohead") - - if __name__ == '__main__': unittest.main(failfast=True) diff --git a/tests/test_pylast_librefm.py b/tests/test_pylast_librefm.py new file mode 100755 index 0000000..61cdced --- /dev/null +++ b/tests/test_pylast_librefm.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +""" +Integration (not unit) tests for pylast.py +""" +import unittest + +from flaky import flaky + +import pylast +from test_pylast import load_secrets + + +@flaky(max_runs=5, min_passes=1) +class TestPyLastWithLibreFm(unittest.TestCase): + """Own class for Libre.fm because we don't need the Last.fm setUp""" + + def test_libre_fm(self): + # Arrange + secrets = load_secrets() + username = secrets["username"] + password_hash = secrets["password_hash"] + + # Act + network = pylast.LibreFMNetwork( + password_hash=password_hash, username=username) + artist = network.get_artist("Radiohead") + name = artist.get_name() + + # Assert + self.assertEqual(name, "Radiohead") + + +if __name__ == '__main__': + unittest.main(failfast=True)