Skip to content

Commit

Permalink
Merge pull request #71 from Bchass/pytest_conversion
Browse files Browse the repository at this point in the history
test conversion
  • Loading branch information
audreyfeldroy authored Oct 8, 2023
2 parents e9e17cd + ed9644f commit 6f9c963
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions tests/test_cli_version.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import unittest
import pytest
import subprocess

class TestCLIVersion(unittest.TestCase):

def test_version_option(self):

@pytest.fixture
def run_cli_command():
# This fixture runs the CLI command and captures its output
def run_command():
# Run the CLI command and capture its output
result = subprocess.run(["python", "-m", "src.interviewkit.cli", "version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
return result

return run_command

self.assertEqual(result.returncode, 0)

# Check if the version number is correct
self.assertIn(f"HistoryAIToolKit: 0.0.1", result.stdout)
class TestCLIVersion():

def test_version_option(self, run_cli_command):
result = run_cli_command()

assert result.returncode == 0

if __name__ == '__main__':
unittest.main()
# Check if the version number is correct
assert f"HistoryAIToolKit: 0.0.1" in result.stdout

0 comments on commit 6f9c963

Please sign in to comment.