mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
MetaSync: fix tests for Windows
This commit is contained in:
parent
afeedd2e70
commit
16531b6cf8
1 changed files with 10 additions and 2 deletions
|
|
@ -12,6 +12,8 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
import os
|
||||
import time
|
||||
from datetime import datetime
|
||||
from beets.library import Item
|
||||
|
||||
from test import _common
|
||||
|
|
@ -19,6 +21,10 @@ from test._common import unittest
|
|||
from test.helper import TestHelper
|
||||
|
||||
|
||||
def _parsetime(s):
|
||||
return time.mktime(datetime.strptime(s, '%Y-%m-%d %H:%M:%S').timetuple())
|
||||
|
||||
|
||||
class MetaSyncTest(_common.TestCase, TestHelper):
|
||||
itunes_library = os.path.join(_common.RSRC, 'itunes_library.xml')
|
||||
|
||||
|
|
@ -75,12 +81,14 @@ class MetaSyncTest(_common.TestCase, TestHelper):
|
|||
self.assertEqual(self.lib.items()[0].itunes_playcount, 0)
|
||||
self.assertEqual(self.lib.items()[0].itunes_skipcount, 3)
|
||||
self.assertFalse(hasattr(self.lib.items()[0], 'itunes_lastplayed'))
|
||||
self.assertEqual(self.lib.items()[0].itunes_lastskipped, 1423147264.0)
|
||||
self.assertEqual(self.lib.items()[0].itunes_lastskipped,
|
||||
_parsetime('2015-02-05 15:41:04'))
|
||||
|
||||
self.assertEqual(self.lib.items()[1].itunes_rating, 100)
|
||||
self.assertEqual(self.lib.items()[1].itunes_playcount, 31)
|
||||
self.assertEqual(self.lib.items()[1].itunes_skipcount, 0)
|
||||
self.assertEqual(self.lib.items()[1].itunes_lastplayed, 1430734851.0)
|
||||
self.assertEqual(self.lib.items()[1].itunes_lastplayed,
|
||||
_parsetime('2015-05-04 12:20:51'))
|
||||
self.assertFalse(hasattr(self.lib.items()[1], 'itunes_lastskipped'))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue