mirror of
https://github.com/beetbox/beets.git
synced 2025-12-31 21:12:43 +01:00
Improve test to not sleep
This commit is contained in:
parent
95f21b6e42
commit
d11c074a85
1 changed files with 3 additions and 6 deletions
|
|
@ -17,7 +17,6 @@ import os
|
|||
import os.path
|
||||
import shutil
|
||||
import tempfile
|
||||
import time
|
||||
import unittest
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
|
|
@ -229,21 +228,19 @@ class EmbedartCliTest(
|
|||
item = album.items()[0]
|
||||
self.io.addinput("y")
|
||||
self.run_command("embedart", "-f", self.small_artpath)
|
||||
embedded_time = item.current_mtime()
|
||||
time.sleep(1)
|
||||
embedded_time = os.path.getmtime(syspath(item.path))
|
||||
|
||||
self.io.addinput("y")
|
||||
self.run_command("clearart")
|
||||
mediafile = MediaFile(syspath(item.path))
|
||||
assert not mediafile.images
|
||||
clear_time = item.current_mtime()
|
||||
clear_time = os.path.getmtime(syspath(item.path))
|
||||
assert clear_time > embedded_time
|
||||
time.sleep(1)
|
||||
|
||||
# A run on a file without an image should not be modified
|
||||
self.io.addinput("y")
|
||||
self.run_command("clearart")
|
||||
no_clear_time = item.current_mtime()
|
||||
no_clear_time = os.path.getmtime(syspath(item.path))
|
||||
assert no_clear_time == clear_time
|
||||
|
||||
def test_clear_art_with_no_input(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue