Refactor TDLib facade and local time handling
This commit is contained in:
@@ -167,8 +167,7 @@ mod credentials_tests {
|
||||
// Примечание: этот тест может зафейлиться если есть credentials файл,
|
||||
// так как он имеет приоритет. Для полноценного тестирования нужно
|
||||
// моковать файловую систему или использовать временные директории.
|
||||
if result.is_ok() {
|
||||
let (api_id, api_hash) = result.unwrap();
|
||||
if let Ok((api_id, api_hash)) = result {
|
||||
// Может быть либо из файла, либо из env
|
||||
assert!(api_id > 0);
|
||||
assert!(!api_hash.is_empty());
|
||||
@@ -210,14 +209,13 @@ mod credentials_tests {
|
||||
let result = Config::load_credentials();
|
||||
|
||||
// Должна быть ошибка
|
||||
if result.is_ok() {
|
||||
if let Err(err_msg) = result {
|
||||
// Проверяем формат ошибки
|
||||
assert!(!err_msg.is_empty(), "Error message should not be empty");
|
||||
} else {
|
||||
// Возможно env переменные установлены глобально и не удаляются
|
||||
// Тест пропускается
|
||||
eprintln!("Warning: credentials loaded despite removing env vars");
|
||||
} else {
|
||||
// Проверяем формат ошибки
|
||||
let err_msg = result.unwrap_err();
|
||||
assert!(!err_msg.is_empty(), "Error message should not be empty");
|
||||
}
|
||||
|
||||
// Восстанавливаем env переменные
|
||||
|
||||
Reference in New Issue
Block a user