Fix lints in tests (#682)

* Fix lints on tests

* Formatting

* Formatting
This commit is contained in:
Nathan Thomas 2024-05-14 16:27:41 -07:00 committed by GitHub
parent 178168cc68
commit 54d05e1330
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 50 additions and 50 deletions

View file

@ -4,8 +4,28 @@ import shutil
import pytest
import tomlkit
from streamrip.config import *
from streamrip.config import _get_dict_keys_r, _nested_set
from streamrip.config import (
ArtworkConfig,
CliConfig,
Config,
ConfigData,
ConversionConfig,
DatabaseConfig,
DeezerConfig,
DownloadsConfig,
FilepathsConfig,
LastFmConfig,
MetadataConfig,
MiscConfig,
QobuzConfig,
QobuzDiscographyFilterConfig,
SoundcloudConfig,
TidalConfig,
YoutubeConfig,
_get_dict_keys_r,
_nested_set,
update_config,
)
SAMPLE_CONFIG = "tests/test_config.toml"
OLD_CONFIG = "tests/test_config_old.toml"
@ -242,15 +262,6 @@ def test_sample_config_data_fields(sample_config_data):
assert sample_config_data.conversion == test_config.conversion
# def test_config_save_file_called_on_del(sample_config, mocker):
# sample_config.file.set_modified()
# mockf = mocker.Mock()
#
# sample_config.save_file = mockf
# sample_config.__del__()
# mockf.assert_called_once()
def test_config_update_on_save():
tmp_config_path = "tests/config2.toml"
shutil.copy(SAMPLE_CONFIG, tmp_config_path)
@ -264,19 +275,6 @@ def test_config_update_on_save():
assert conf2.session.downloads.folder == "new_folder"
# def test_config_update_on_del():
# tmp_config_path = "tests/config2.toml"
# shutil.copy(SAMPLE_CONFIG, tmp_config_path)
# conf = Config(tmp_config_path)
# conf.file.downloads.folder = "new_folder"
# conf.file.set_modified()
# del conf
# conf2 = Config(tmp_config_path)
# os.remove(tmp_config_path)
#
# assert conf2.session.downloads.folder == "new_folder"
def test_config_dont_update_without_set_modified():
tmp_config_path = "tests/config2.toml"
shutil.copy(SAMPLE_CONFIG, tmp_config_path)