mirror of
https://github.com/beetbox/beets.git
synced 2025-12-24 09:33:46 +01:00
Merge pull request #2016 from jrobeson/octal-confusions
clear up octal confusions for python 2/3 compat
This commit is contained in:
commit
47f2a4ef31
2 changed files with 7 additions and 7 deletions
|
|
@ -103,15 +103,15 @@ class MoveTest(_common.TestCase):
|
|||
|
||||
def test_read_only_file_copied_writable(self):
|
||||
# Make the source file read-only.
|
||||
os.chmod(self.path, 0444)
|
||||
os.chmod(self.path, 0o444)
|
||||
|
||||
try:
|
||||
self.i.move(copy=True)
|
||||
self.assertTrue(os.access(self.i.path, os.W_OK))
|
||||
finally:
|
||||
# Make everything writable so it can be cleaned up.
|
||||
os.chmod(self.path, 0777)
|
||||
os.chmod(self.i.path, 0777)
|
||||
os.chmod(self.path, 0o777)
|
||||
os.chmod(self.i.path, 0o777)
|
||||
|
||||
def test_move_avoids_collision_with_existing_file(self):
|
||||
# Make a conflicting file at the destination.
|
||||
|
|
@ -354,7 +354,7 @@ class ArtFileTest(_common.TestCase):
|
|||
|
||||
newart = os.path.join(self.libdir, 'newart.jpg')
|
||||
touch(newart)
|
||||
os.chmod(newart, 0400) # read-only
|
||||
os.chmod(newart, 0o400) # read-only
|
||||
|
||||
try:
|
||||
i2 = item()
|
||||
|
|
@ -370,8 +370,8 @@ class ArtFileTest(_common.TestCase):
|
|||
|
||||
finally:
|
||||
# Make everything writable so it can be cleaned up.
|
||||
os.chmod(newart, 0777)
|
||||
os.chmod(ai.artpath, 0777)
|
||||
os.chmod(newart, 0o777)
|
||||
os.chmod(ai.artpath, 0o777)
|
||||
|
||||
def test_move_last_file_moves_albumart(self):
|
||||
oldartpath = self.lib.albums()[0].artpath
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class TypesPluginTest(unittest.TestCase, TestHelper):
|
|||
|
||||
self.modify(u'mydate=1999-01-01', u'artist:prince')
|
||||
old.load()
|
||||
self.assertEqual(old['mydate'], mktime(1999, 01, 01))
|
||||
self.assertEqual(old['mydate'], mktime(1999, 1, 1))
|
||||
|
||||
self.modify(u'mydate=1999-12-30', u'artist:britney')
|
||||
new.load()
|
||||
|
|
|
|||
Loading…
Reference in a new issue