From db3ed0fc3c599283756658c0eda6985171ebbd93 Mon Sep 17 00:00:00 2001 From: hugovk Date: Mon, 7 Apr 2014 13:18:36 +0300 Subject: [PATCH] Add country tests --- test_pylast.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test_pylast.py b/test_pylast.py index 7942b39..054d277 100755 --- a/test_pylast.py +++ b/test_pylast.py @@ -1784,6 +1784,25 @@ class TestPyLast(unittest.TestCase): self.assertGreater(review_count, 0) self.assertGreater(attendance_count, 100) + def test_countries(self): + # Arrange + country1 = pylast.Country("Italy", self.network) + country2 = pylast.Country("Finland", self.network) + + # Act + text = str(country1) + rep = repr(country1) + url = country1.get_url() + + # Assert + self.assertIn("Italy", rep) + self.assertIn("pylast.Country", rep) + self.assertEqual(text, "Italy") + self.assertTrue(country1 == country1) + self.assertTrue(country1 != country2) + self.assertEqual(url, "http://www.last.fm/place/italy") + + if __name__ == '__main__': parser = argparse.ArgumentParser( description="Integration (not unit) tests for pylast.py",