Fix tests
This commit is contained in:
parent
3bf73a21ff
commit
1c26ef6d24
49
setup.py
49
setup.py
|
@ -3,30 +3,35 @@
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
def get_build():
|
def get_build():
|
||||||
path = "./.build"
|
path = "./.build"
|
||||||
|
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
fp = open(path, "r")
|
fp = open(path, "r")
|
||||||
build = eval(fp.read())
|
build = eval(fp.read())
|
||||||
if os.path.exists("./.increase_build"):
|
if os.path.exists("./.increase_build"):
|
||||||
build += 1
|
build += 1
|
||||||
fp.close()
|
fp.close()
|
||||||
else:
|
else:
|
||||||
build = 1
|
build = 1
|
||||||
|
|
||||||
fp = open(path, "w")
|
fp = open(path, "w")
|
||||||
fp.write(str(build))
|
fp.write(str(build))
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
return str(build)
|
return str(build)
|
||||||
|
|
||||||
setup(name = "pylast",
|
setup(
|
||||||
version = "0.6." + get_build(),
|
name="pylast",
|
||||||
author = "Amr Hassan <amr.hassan@gmail.com>",
|
version="0.6." + get_build(),
|
||||||
description = "A Python interface to Last.fm (and other API compatible social networks)",
|
author="Amr Hassan <amr.hassan@gmail.com>",
|
||||||
author_email = "amr.hassan@gmail.com",
|
description="A Python interface to Last.fm (and other API compatible social networks)",
|
||||||
url = "https://github.com/hugovk/",
|
author_email="amr.hassan@gmail.com",
|
||||||
py_modules = ("pylast",),
|
url="https://github.com/hugovk/pylast",
|
||||||
license = "Apache2"
|
py_modules=("pylast",),
|
||||||
)
|
license="Apache2"
|
||||||
|
)
|
||||||
|
|
||||||
|
# End of file
|
||||||
|
|
|
@ -1606,13 +1606,13 @@ class TestPyLast(unittest.TestCase):
|
||||||
tags_after = artist.get_tags()
|
tags_after = artist.get_tags()
|
||||||
self.assertEqual(len(tags_after), len(tags_before) - 2)
|
self.assertEqual(len(tags_after), len(tags_before) - 2)
|
||||||
found1, found2 = False, False
|
found1, found2 = False, False
|
||||||
for tag in tags:
|
for tag in tags_after:
|
||||||
if tag == "removetag1":
|
if tag.name == "removetag1":
|
||||||
found1 = True
|
found1 = True
|
||||||
elif tag == "removetag2":
|
elif tag.name == "removetag2":
|
||||||
found2 = True
|
found2 = True
|
||||||
self.assertTrue(found1)
|
self.assertFalse(found1)
|
||||||
self.assertTrue(found2)
|
self.assertFalse(found2)
|
||||||
|
|
||||||
def test_set_tags(self):
|
def test_set_tags(self):
|
||||||
# Arrange
|
# Arrange
|
||||||
|
@ -1630,10 +1630,10 @@ class TestPyLast(unittest.TestCase):
|
||||||
self.assertNotEqual(tags_before, tags_after)
|
self.assertNotEqual(tags_before, tags_after)
|
||||||
self.assertEqual(len(tags_after), 2)
|
self.assertEqual(len(tags_after), 2)
|
||||||
found1, found2 = False, False
|
found1, found2 = False, False
|
||||||
for tag in tags:
|
for tag in tags_after:
|
||||||
if tag == "settag1":
|
if tag.name == "settag1":
|
||||||
found1 = True
|
found1 = True
|
||||||
elif tag == "settag2":
|
elif tag.name == "settag2":
|
||||||
found2 = True
|
found2 = True
|
||||||
self.assertTrue(found1)
|
self.assertTrue(found1)
|
||||||
self.assertTrue(found2)
|
self.assertTrue(found2)
|
||||||
|
|
Loading…
Reference in a new issue