From cede0ed4660a76ea1b38bb65e10e10d416bbf3f4 Mon Sep 17 00:00:00 2001 From: Johnny Robeson Date: Thu, 26 May 2016 06:13:14 -0400 Subject: [PATCH 1/2] remove leading 0 when octal is unwanted --- test/test_types_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_types_plugin.py b/test/test_types_plugin.py index 7af1a8d72..ed5a7552c 100644 --- a/test/test_types_plugin.py +++ b/test/test_types_plugin.py @@ -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() From 7f41d5c188dfac5631500c1b44901f694afe1f32 Mon Sep 17 00:00:00 2001 From: Johnny Robeson Date: Thu, 26 May 2016 06:12:23 -0400 Subject: [PATCH 2/2] use 0o prefix when we want octal --- test/test_files.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/test_files.py b/test/test_files.py index e3e4857c9..e27e317cb 100644 --- a/test/test_files.py +++ b/test/test_files.py @@ -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