@@ -35,12 +35,14 @@ def test_on_source_setup_sets_properties(config, provider):
35
35
mock_source = mock .MagicMock ()
36
36
provider .on_source_setup (mock_source )
37
37
spotify_cache_dir = backend .Extension .get_cache_dir (config )
38
+ spotify_data_dir = backend .Extension .get_data_dir (config )
39
+ cred_dir = spotify_data_dir / "credentials-cache"
38
40
39
41
assert mock_source .set_property .mock_calls == [
40
42
mock .call ("username" , "alice" ),
41
43
mock .call ("password" , "password" ),
42
44
mock .call ("bitrate" , "160" ),
43
- mock .call ("cache-credentials" , spotify_cache_dir ),
45
+ mock .call ("cache-credentials" , cred_dir ),
44
46
mock .call ("cache-files" , spotify_cache_dir ),
45
47
mock .call ("cache-max-size" , 8589934592 ),
46
48
]
@@ -50,11 +52,14 @@ def test_on_source_setup_without_caching(config, provider):
50
52
config ["spotify" ]["allow_cache" ] = False
51
53
mock_source = mock .MagicMock ()
52
54
provider .on_source_setup (mock_source )
55
+ spotify_data_dir = backend .Extension .get_data_dir (config )
56
+ cred_dir = spotify_data_dir / "credentials-cache"
53
57
54
58
assert mock_source .set_property .mock_calls == [
55
59
mock .call ("username" , "alice" ),
56
60
mock .call ("password" , "password" ),
57
61
mock .call ("bitrate" , "160" ),
62
+ mock .call ("cache-credentials" , cred_dir ),
58
63
]
59
64
60
65
0 commit comments