File: test_activator.py

package info (click to toggle)
python-virtualenv 20.17.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,580 kB
  • sloc: python: 9,952; sh: 149; ansic: 61; csh: 35; makefile: 10
file content (16 lines) | stat: -rw-r--r-- 438 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from argparse import Namespace

from virtualenv.activation.activator import Activator


def test_activator_prompt_cwd(monkeypatch, tmp_path):
    class FakeActivator(Activator):
        def generate(self, creator):  # noqa: U100
            raise NotImplementedError

    cwd = tmp_path / "magic"
    cwd.mkdir()
    monkeypatch.chdir(cwd)

    activator = FakeActivator(Namespace(prompt="."))
    assert activator.flag_prompt == "magic"