-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from elkinaguas/add-tests
Add tests
- Loading branch information
Showing
6 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import os | ||
import subprocess | ||
|
||
subprocess.run(['clir', 'init'], capture_output=True, text=True) | ||
dir_path = os.path.expanduser('~/.clir') | ||
file_path = os.path.expanduser('~/.clir/commands.json') | ||
command_file_creation_time = os.path.getctime(file_path) | ||
|
||
# Test if the clir folder environment was created | ||
def test_clir_project_folder_created(): | ||
assert os.path.exists(dir_path) | ||
|
||
# Test if the commands.json file was created | ||
def test_command_file_created(): | ||
assert os.path.exists(file_path) | ||
|
||
# Test if init command doesn't recreate the commands.json file | ||
def test_init_command_doesnt_recreate_commands_json(): | ||
subprocess.run(['clir', 'init'], capture_output=True, text=True) | ||
assert os.path.getctime(file_path) == command_file_creation_time |
Empty file.
Empty file.
Empty file.