mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
feat: Implement Python virtual environment display (#137)
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
use ansi_term::Color;
|
||||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::io;
|
||||
|
||||
use ansi_term::Color;
|
||||
|
||||
use crate::common;
|
||||
|
||||
#[test]
|
||||
@@ -71,3 +73,23 @@ fn folder_with_py_file() -> io::Result<()> {
|
||||
assert_eq!(expected, actual);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn with_virtual_env() -> io::Result<()> {
|
||||
let dir = common::new_tempdir()?;
|
||||
File::create(dir.path().join("main.py"))?;
|
||||
let output = common::render_module("python")
|
||||
.env("VIRTUAL_ENV", "/foo/bar/my_venv")
|
||||
.arg("--path")
|
||||
.arg(dir.path())
|
||||
.output()?;
|
||||
let actual = String::from_utf8(output.stdout).unwrap();
|
||||
|
||||
let expected = format!(
|
||||
"via {} ",
|
||||
Color::Yellow.bold().paint("🐍 v3.6.9(my_venv)")
|
||||
);
|
||||
assert_eq!(expected, actual);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user