Skip to content

Commit

Permalink
chore: resolve rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytelife26 committed Jan 25, 2024
1 parent 90d610f commit 2104094
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
1 change: 1 addition & 0 deletions tests/test-proselintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"nonwords.misc" : true,
"oxymorons.misc" : true,
"psychology.misc" : true,
"punctuation_spacing.misc" : true,
"redundancy.misc" : true,
"redundancy.ras_syndrome" : true,
"skunked_terms.misc" : true,
Expand Down
15 changes: 7 additions & 8 deletions tests/test_config_flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,27 @@ def test_deepmerge_dicts():
d2 = {"a": 2, "b": {"c": 3, "e": 4}}
assert _deepmerge_dicts(d1, d2) == {"a": 2, "b": {"c": 3, "d": 3, "e": 4}}


@patch("os.path.isfile")
def test_load_options_function(isfile):
"""Test load_options by specifying a user options path"""
isfile.side_effect = CONFIG_FILE.__eq__

overrides = load_options(CONFIG_FILE)
assert load_options()["checks"]["uncomparables.misc"]
default = load_options()
assert default == proselint_base
assert default["checks"]["uncomparables.misc"]
assert not overrides["checks"]["uncomparables.misc"]

isfile.side_effect = os.path.join(os.getcwd(), ".proselintrc").__eq__

assert load_options() == default
isfile.side_effect = os.path.join(os.getcwd(), ".proselintrc.json").__eq__

def test_config_flag_demo():
"""Test the --config CLI argument"""
result = CliRunner().invoke(proselint, ["--demo"])
result = CliRunner().invoke(proselint, ["--demo", "-v"])
print_invoke_return(result)
assert "uncomparables.misc" in result.stdout

def test_config_flag_config():
result = runner.invoke(proselint, ["--demo", "--debug"] + FLAG)
result = CliRunner().invoke(proselint, ["--demo", "-v"] + FLAG)
print_invoke_return(result)
assert "uncomparables.misc" not in result.stdout

Expand All @@ -70,6 +69,6 @@ def test_dump_config():
if triggered, the input-cfg was extended with the default-config
-> add missing flags to input-cfg!
"""
output = runner.invoke(proselint, ["--dump-config"] + FLAG)
output = CliRunner().invoke(proselint, ["--dump-config"] + FLAG)
assert json.loads(output.stdout) == json.load(CONFIG_FILE.open())

3 changes: 1 addition & 2 deletions tests/test_invalid_chars.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ def test_invalid_characters():
"""Ensure that invalid characters do not break proselint."""
runner = CliRunner()

result = runner.invoke(proselint, CHAR_FILE)
result = runner.invoke(proselint, CHAR_FILE.as_posix())
print_invoke_return(result)

assert len(result.stdout) > 0
assert result.exit_code == 0
assert "UnicodeDecodeError" not in result.stdout
assert "FileNotFoundError" not in result.stdout

0 comments on commit 2104094

Please sign in to comment.