summaryrefslogtreecommitdiff
path: root/src/commands/update.rs
diff options
context:
space:
mode:
authorfx <[email protected]>2023-04-27 10:10:03 +0200
committerfx <[email protected]>2023-04-27 10:10:03 +0200
commit43ca5fec20933fc31dfe7d7dbd1f1b9258612219 (patch)
treeeef58fecfadad90386b38af581abab8cc3d3cfc0 /src/commands/update.rs
parent4300ad2eb05dddfa4274e04b204f2ad28c87da05 (diff)
parent4e6466af1329f7b9e341df2e76ab696d11f80c93 (diff)
downloadmodlist-43ca5fec20933fc31dfe7d7dbd1f1b9258612219.tar
modlist-43ca5fec20933fc31dfe7d7dbd1f1b9258612219.tar.gz
modlist-43ca5fec20933fc31dfe7d7dbd1f1b9258612219.zip
Merge pull request 'cache' (#3) from cache into master
Reviewed-on: http://raspberrypi.fritz.box:7920/fx/modlist/pulls/3
Diffstat (limited to 'src/commands/update.rs')
-rw-r--r--src/commands/update.rs98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/commands/update.rs b/src/commands/update.rs
index 3d9578b..4bc3ac0 100644
--- a/src/commands/update.rs
+++ b/src/commands/update.rs
@@ -156,52 +156,52 @@ async fn specific_update(config: Cfg, clean: bool, list: List, id: String) -> ML
156 Ok(current[0].clone()) 156 Ok(current[0].clone())
157} 157}
158 158
159#[tokio::test] 159// #[tokio::test]
160async fn download_updates_test() { 160// async fn download_updates_test() {
161 use crate::{ 161// use crate::{
162 modrinth::{Hash, Version, VersionFile, VersionType}, 162// modrinth::{Hash, Version, VersionFile, VersionType},
163 List, Modloader, 163// List, Modloader,
164 }; 164// };
165 165//
166 let config = Cfg::init("modlist.toml").unwrap(); 166// let config = Cfg::init().unwrap();
167 let current_list = List { 167// let current_list = List {
168 id: String::from("..."), 168// id: String::from("..."),
169 mc_version: String::from("..."), 169// mc_version: String::from("..."),
170 modloader: Modloader::Fabric, 170// modloader: Modloader::Fabric,
171 download_folder: String::from("./dev/tests/dl"), 171// download_folder: String::from("./dev/tests/dl"),
172 }; 172// };
173 173//
174 let versions = vec![Version { 174// let versions = vec![Version {
175 id: "dEqtGnT9".to_string(), 175// id: "dEqtGnT9".to_string(),
176 project_id: "kYuIpRLv".to_string(), 176// project_id: "kYuIpRLv".to_string(),
177 author_id: "Qnt13hO8".to_string(), 177// author_id: "Qnt13hO8".to_string(),
178 featured: true, 178// featured: true,
179 name: "1.2.2-1.19 - Fabric".to_string(), 179// name: "1.2.2-1.19 - Fabric".to_string(),
180 version_number: "1.2.2-1.19".to_string(), 180// version_number: "1.2.2-1.19".to_string(),
181 changelog: None, 181// changelog: None,
182 date_published: "2022-11-02T17:41:43.072267Z".to_string(), 182// date_published: "2022-11-02T17:41:43.072267Z".to_string(),
183 downloads: 58, 183// downloads: 58,
184 version_type: VersionType::release, 184// version_type: VersionType::release,
185 files: vec![VersionFile { 185// files: vec![VersionFile {
186 hashes: Hash { 186// hashes: Hash {
187 sha1: "fdc6dc39427fc92cc1d7ad8b275b5b83325e712b".to_string(), 187// sha1: "fdc6dc39427fc92cc1d7ad8b275b5b83325e712b".to_string(),
188 sha512: "5b372f00d6e5d6a5ef225c3897826b9f6a2be5506905f7f71b9e939779765b41be6f2a9b029cfc752ad0751d0d2d5f8bb4544408df1363eebdde15641e99a849".to_string() 188// sha512: "5b372f00d6e5d6a5ef225c3897826b9f6a2be5506905f7f71b9e939779765b41be6f2a9b029cfc752ad0751d0d2d5f8bb4544408df1363eebdde15641e99a849".to_string()
189 }, 189// },
190 url: "https://cdn.modrinth.com/data/kYuIpRLv/versions/dEqtGnT9/waveycapes-fabric-1.2.2-mc1.19.2.jar".to_string(), 190// url: "https://cdn.modrinth.com/data/kYuIpRLv/versions/dEqtGnT9/waveycapes-fabric-1.2.2-mc1.19.2.jar".to_string(),
191 filename: "waveycapes-fabric-1.2.2-mc1.19.2.jar".to_string(), 191// filename: "waveycapes-fabric-1.2.2-mc1.19.2.jar".to_string(),
192 primary: true, 192// primary: true,
193 size: 323176 193// size: 323176
194 }], 194// }],
195 game_versions: vec![ 195// game_versions: vec![
196 "1.19".to_string(), 196// "1.19".to_string(),
197 "1.19.1".to_string(), 197// "1.19.1".to_string(),
198 "1.19.2".to_string() 198// "1.19.2".to_string()
199 ], 199// ],
200 loaders: vec![ 200// loaders: vec![
201 "fabric".to_string() 201// "fabric".to_string()
202 ] 202// ]
203 }]; 203// }];
204 assert!(download_versions(current_list, config, versions) 204// assert!(download_versions(current_list, config, versions)
205 .await 205// .await
206 .is_ok()) 206// .is_ok())
207} 207// }