Skip to content

Commit

Permalink
Invoke init connection to avoid sender test failure
Browse files Browse the repository at this point in the history
It has been failing since february, probably around layer 138.
  • Loading branch information
Lonami committed Jul 19, 2022
1 parent ba12178 commit 7bd6d95
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions lib/grammers-mtsender/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub const TELEGRAM_DEFAULT_TEST_DC: &str = TELEGRAM_TEST_DC_2;

use grammers_mtproto::transport;
use grammers_mtsender::connect;
use grammers_tl_types::{enums, functions, Deserializable, RemoteCall};
use grammers_tl_types::{enums, functions, Deserializable, RemoteCall, LAYER};
use log;
use simple_logger::SimpleLogger;
use tokio::runtime;
Expand All @@ -34,7 +34,21 @@ fn test_invoke_encrypted_method() {
.await
.unwrap();

let mut rx = enqueuer.enqueue(&functions::help::GetNearestDc {});
let mut rx = enqueuer.enqueue(&functions::InvokeWithLayer {
layer: LAYER,
query: functions::InitConnection {
api_id: 1,
device_model: "Test".to_string(),
system_version: "0.1".to_string(),
app_version: "0.1".to_string(),
system_lang_code: "en".to_string(),
lang_pack: "".to_string(),
lang_code: "".to_string(),
proxy: None,
params: None,
query: functions::help::GetNearestDc {},
},
});
loop {
sender.step().await.unwrap();
if let Ok(response) = rx.try_recv() {
Expand Down

0 comments on commit 7bd6d95

Please sign in to comment.