Exemple #1
0
def test_load_config_defaults():
    config = load_config(str(fixtures_dir / "example.py"))

    assert config == {
        "line_length": 88,
        "target_version": set(),
        "pyi": False,
        "fast": False,
        "skip_string_normalization": False,
    }
Exemple #2
0
def test_load_config():
    config = load_config(str(fixtures_dir / "config" / "example.py"))

    # TODO split into smaller tests
    assert config == {
        "line_length": 20,
        "target_version": set(),
        "pyi": True,
        "fast": True,
        "skip_string_normalization": True,
    }
def test_load_config_defaults():
    config = load_config(fixtures_dir / "example.py")

    assert config == {
        "line_length": 88,
        "py36": False,
        "pyi": False,
        "fast": False,
        "skip_string_normalization": False,
        "skip_numeric_underscore_normalization": False,
    }
def test_load_config():
    config = load_config(fixtures_dir / "config" / "example.py")

    assert config == {
        "line_length": 20,
        "py36": True,
        "pyi": True,
        "fast": True,
        "skip_string_normalization": True,
        "skip_numeric_underscore_normalization": True,
    }
Exemple #5
0
def test_load_config_py36():
    config = load_config(str(fixtures_dir / "py36" / "example.py"))

    assert config["target_version"] == _PY36_VERSIONS
Exemple #6
0
def test_load_config_target_version():
    config = load_config(str(fixtures_dir / "target_version" / "example.py"))

    assert config["target_version"] == {black.TargetVersion.PY27}