nbr 0.4.3

CLI for NoneBot2 - A Rust implementation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
mod common;
use nbr::cli::generate::generate_bot_file;
use std::fs;

#[tokio::test]
async fn test_generate_bot_file_snapshot() {
    let (_dir, project_path) = common::create_temp_project(false).await;

    // Generate bot file
    generate_bot_file(&project_path, true).await.unwrap();

    // Snapshot bot.py
    let bot_py_content = fs::read_to_string(project_path.join("bot.py")).unwrap();
    insta::assert_snapshot!(bot_py_content);
}