Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Commit

Permalink
Cleaned off the boolean in assert
Browse files Browse the repository at this point in the history
  • Loading branch information
hSaria committed Feb 8, 2020
1 parent 8b2eb35 commit ba79a8d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chromaterm/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,25 +121,25 @@ def test_find_rule():

def test_write_default_config():
"""Write config file."""
assert chromaterm.misc.write_default_config('.', TEMP_FILE + '1') is True
assert chromaterm.misc.write_default_config('.', TEMP_FILE + '1')
assert os.access(os.path.join('.', TEMP_FILE + '1'), os.F_OK)
os.remove(TEMP_FILE + '1')


def test_write_default_config_no_directory():
"""No directory for default config (e.g. no home)."""
assert chromaterm.misc.write_default_config(None) is False
assert not chromaterm.misc.write_default_config(None)


def test_write_default_config_exists():
"""Config file already exists."""
open(TEMP_FILE + '2', 'w').close()
assert chromaterm.misc.write_default_config('.', TEMP_FILE + '2') is False
assert not chromaterm.misc.write_default_config('.', TEMP_FILE + '2')
os.remove(TEMP_FILE + '2')


def test_write_default_config_no_permission():
"""No write permission on directory."""
os.mkdir(TEMP_DIR + '1', mode=0o444)
assert chromaterm.misc.write_default_config(TEMP_DIR + '1') is False
assert not chromaterm.misc.write_default_config(TEMP_DIR + '1')
os.rmdir(TEMP_DIR + '1')

0 comments on commit ba79a8d

Please sign in to comment.