mirror of
https://github.com/beetbox/beets.git
synced 2026-01-06 07:53:40 +01:00
added test for human_seconds
This commit is contained in:
parent
59d7b96a66
commit
b293d6ad88
1 changed files with 26 additions and 0 deletions
|
|
@ -84,6 +84,32 @@ class QueryTest(_common.TestCase):
|
|||
self.check_do_query(0, 2, album=True, also_items=False)
|
||||
|
||||
|
||||
class InitTest(_common.LibTestCase):
|
||||
def setUp(self):
|
||||
super(InitTest, self).setUp()
|
||||
|
||||
self.io.install()
|
||||
|
||||
def tearDown(self):
|
||||
self.io.restore()
|
||||
|
||||
def test_human_seconds(self):
|
||||
tests = [
|
||||
(0, '0.0 seconds'),
|
||||
(30, '30.0 seconds'),
|
||||
(60, '1.0 minutes'),
|
||||
(90, '1.5 minutes'),
|
||||
(125, '2.1 minutes'),
|
||||
(3600, '1.0 hours'),
|
||||
(86400, '1.0 days'),
|
||||
(604800, '1.0 weeks'),
|
||||
(31449600, '1.0 years'),
|
||||
(314496000, '1.0 decades'),
|
||||
]
|
||||
for i, h in tests:
|
||||
self.assertEqual(h, ui.human_seconds(i))
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue