MCPcopy
hub / github.com/scdl-org/scdl / test_sync

Function test_sync

tests/test_playlist.py:121–155  ·  view source on GitHub ↗
(tmp_path: Path)

Source from the content-addressed store, hash-verified

119
120
121def test_sync(tmp_path: Path) -> None:
122 os.chdir(tmp_path)
123 os.makedirs("test playlist")
124 r = call_scdl_with_auth(
125 "-l",
126 "https://soundcloud.com/7x11x13/wan-bushi-eurodance-vibes-part-123",
127 "--onlymp3",
128 "--name-format",
129 "remove_this",
130 "--path",
131 "test playlist",
132 )
133 assert r.returncode == 0
134 assert_track(
135 tmp_path / "test playlist",
136 "remove_this.mp3",
137 check_metadata=False,
138 )
139 with open("archive.txt", "w", encoding="utf-8") as f:
140 f.writelines(["soundcloud 1032303631 ./test playlist/remove_this.mp3"])
141 r = call_scdl_with_auth(
142 "-l",
143 "https://soundcloud.com/one-thousand-and-one/sets/test-playlist/s-ZSLfNrbPoXR",
144 "--playlist-name-format",
145 "{title}",
146 "--sync",
147 "archive.txt",
148 )
149 assert r.returncode == 0
150 assert_not_track(tmp_path / "test playlist", "remove_this.mp3")
151 with open("archive.txt") as f:
152 assert [line.split()[1] for line in f.read().splitlines()] == [
153 "1855267053",
154 "1855318536",
155 ]

Callers

nothing calls this directly

Calls 3

call_scdl_with_authFunction · 0.90
assert_trackFunction · 0.90
assert_not_trackFunction · 0.90

Tested by

no test coverage detected