Coverage for tests/test_cli/test_prisma.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2024-08-27 18:25 +0000

1from pathlib import Path 

2 

3from prisma.cli import prisma 

4from prisma._config import Config 

5 

6from ..utils import set_config 

7 

8 

9def test_package_json_in_parent_dir(tmp_path: Path) -> None: 

10 """The CLI can be installed successfully when there is a `package.json` file 

11 in a parent directory. 

12 """ 

13 tmp_path.joinpath('package.json').write_text('{"name": "prisma-binaries"}') 

14 cache_dir = tmp_path / 'foo' / 'bar' 

15 

16 with set_config( 

17 Config.parse( 

18 binary_cache_dir=cache_dir, 

19 ) 

20 ): 

21 assert prisma.run(['-v']) == 0