Skip to content

Commit

Permalink
Tests first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
elkinaguas committed Nov 11, 2023
1 parent a3e25c4 commit 527cac0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
Empty file added tests/add_command.py
Empty file.
20 changes: 20 additions & 0 deletions tests/init_clir.py
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 added tests/list_command.py
Empty file.
Empty file added tests/remove_command.py
Empty file.
Empty file added tests/run_command.py
Empty file.

0 comments on commit 527cac0

Please sign in to comment.