Skip to content

Commit

Permalink
chore: updated test for create_app, added additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
ashupednekar committed Sep 28, 2024
1 parent 9159a71 commit b5895dd
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion integration_tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@


# Unit tests
def test_create_robyn_app():
def test_create_robyn_app_simple():
with patch("robyn.cli.prompt") as mock_prompt:
mock_prompt.return_value = {
"directory": "test_dir",
"docker": "N",
"scaffold_type": "simple",
"project_type": "no-db",
}
with patch("robyn.cli.os.makedirs") as mock_makedirs:
Expand All @@ -17,6 +18,21 @@ def test_create_robyn_app():
mock_makedirs.assert_called_once()
mock_copytree.assert_called_once()

def test_create_robyn_app_structured():
with patch("robyn.cli.prompt") as mock_prompt:
mock_prompt.return_value = {
"directory": "test_dir",
"docker": "N",
"scaffold_type": "structured",
"project_type": "no-db",
}
with patch("robyn.cli.os.makedirs") as mock_makedirs:
with patch("robyn.cli.shutil.copytree") as mock_copytree, patch("robyn.os.remove") as _mock_remove:
create_robyn_app()
mock_makedirs.assert_called_once()
mock_copytree.assert_called_once()



def test_docs():
with patch("robyn.cli.webbrowser.open") as mock_open:
Expand Down

0 comments on commit b5895dd

Please sign in to comment.