File: test_output.py

package info (click to toggle)
isort 7.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,548 kB
  • sloc: python: 15,337; javascript: 42; makefile: 28; sh: 22
file content (22 lines) | stat: -rw-r--r-- 578 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from hypothesis import given, reject
from hypothesis import strategies as st

import isort.comments


@given(
    comments=st.one_of(st.none(), st.lists(st.text())),
    original_string=st.text(),
    removed=st.booleans(),
    comment_prefix=st.text(),
)
def test_fuzz_add_to_line(comments, original_string, removed, comment_prefix):
    try:
        isort.comments.add_to_line(
            comments=comments,
            original_string=original_string,
            removed=removed,
            comment_prefix=comment_prefix,
        )
    except ValueError:
        reject()