-
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.
- Loading branch information
1 parent
a3e25c4
commit 527cac0
Showing
5 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
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.