File: test_types.py

package info (click to toggle)
python-cloup 3.0.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 936 kB
  • sloc: python: 5,371; makefile: 120
file content (27 lines) | stat: -rw-r--r-- 492 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import pathlib

import click

import cloup


def test_path():
    p = cloup.path()
    assert isinstance(p, click.Path)
    assert p.type == pathlib.Path


def test_dir_path():
    p = cloup.dir_path()
    assert isinstance(p, click.Path)
    assert p.type == pathlib.Path
    assert not p.file_okay
    assert p.dir_okay


def test_file_path():
    p = cloup.file_path()
    assert isinstance(p, click.Path)
    assert p.type == pathlib.Path
    assert not p.dir_okay
    assert p.file_okay