()
| 26 | |
| 27 | #[test] |
| 28 | fn install_with_default_policies() { |
| 29 | let TestEnv { |
| 30 | env, controller, .. |
| 31 | } = setup_new_env(); |
| 32 | |
| 33 | let canister_id = env.create_canister_with_settings(Some(controller), None); |
| 34 | |
| 35 | env.set_controllers(canister_id, Some(controller), vec![canister_id, controller]) |
| 36 | .expect("failed to set canister controller"); |
| 37 | |
| 38 | env.add_cycles(canister_id, 5_000_000_000_000); |
| 39 | let station_wasm = get_canister_wasm("station").to_vec(); |
| 40 | let upgrader_wasm = get_canister_wasm("upgrader").to_vec(); |
| 41 | |
| 42 | let asset_1_id = Uuid::new_v4().hyphenated().to_string(); |
| 43 | let asset_2_id = Uuid::new_v4().hyphenated().to_string(); |
| 44 | |
| 45 | let account_1_id = Uuid::new_v4().hyphenated().to_string(); |
| 46 | |
| 47 | let users = vec![ |
| 48 | InitUserInput { |
| 49 | identities: vec![UserIdentityInput { |
| 50 | identity: WALLET_ADMIN_USER, |
| 51 | }], |
| 52 | name: "station-admin".to_string(), |
| 53 | groups: None, |
| 54 | id: None, |
| 55 | status: station_api::UserStatusDTO::Active, |
| 56 | }, |
| 57 | InitUserInput { |
| 58 | identities: vec![UserIdentityInput { |
| 59 | identity: Principal::from_slice(&[2; 29]), |
| 60 | }], |
| 61 | name: "inactive-station-admin".to_string(), |
| 62 | groups: Some(vec![ADMIN_GROUP_ID.hyphenated().to_string()]), |
| 63 | id: None, |
| 64 | status: station_api::UserStatusDTO::Inactive, |
| 65 | }, |
| 66 | InitUserInput { |
| 67 | identities: vec![UserIdentityInput { |
| 68 | identity: Principal::from_slice(&[3; 29]), |
| 69 | }], |
| 70 | name: "other-user".to_string(), |
| 71 | groups: Some(vec![]), |
| 72 | id: None, |
| 73 | status: station_api::UserStatusDTO::Active, |
| 74 | }, |
| 75 | ]; |
| 76 | |
| 77 | let accounts = vec![station_api::InitAccountInput { |
| 78 | name: "test-account".to_string(), |
| 79 | id: Some(account_1_id.clone()), |
| 80 | metadata: vec![MetadataDTO { |
| 81 | key: "test-key".to_string(), |
| 82 | value: "test-value".to_string(), |
| 83 | }], |
| 84 | assets: vec![asset_1_id.clone(), asset_2_id.clone()], |
| 85 | seed: Uuid::new_v4().to_bytes_le(), |
nothing calls this directly
no test coverage detected