fixed broken test w/ burnettk

This commit is contained in:
jasquat 2022-12-09 15:19:43 -05:00
parent d37550fa43
commit d7221690f0
2 changed files with 88 additions and 87 deletions

View File

@ -9,6 +9,7 @@ import pytest
from flask.app import Flask from flask.app import Flask
from flask.testing import FlaskClient from flask.testing import FlaskClient
from flask_bpmn.models.db import db from flask_bpmn.models.db import db
from spiffworkflow_backend.services.git_service import GitService
from tests.spiffworkflow_backend.helpers.base_test import BaseTest from tests.spiffworkflow_backend.helpers.base_test import BaseTest
from tests.spiffworkflow_backend.helpers.test_data import load_test_spec from tests.spiffworkflow_backend.helpers.test_data import load_test_spec
@ -2564,11 +2565,11 @@ class TestProcessApi(BaseTest):
) -> None: ) -> None:
"""Test_process_model_publish.""" """Test_process_model_publish."""
bpmn_root = FileSystemService.root_path() bpmn_root = FileSystemService.root_path()
shell_command = f"git init {bpmn_root}" shell_command = ["git", "init", bpmn_root]
output = os.popen(shell_command).read() # noqa: S605 output = GitService.run_shell_command_to_get_stdout(shell_command)
assert output == f"Initialized empty Git repository in {bpmn_root}/.git/\n" assert output == f"Initialized empty Git repository in {bpmn_root}/.git/\n"
os.chdir(bpmn_root) with FileSystemService.cd(bpmn_root):
output = os.popen("git status").read() # noqa: S605 output = GitService.run_shell_command_to_get_stdout(["git", "status"])
assert "On branch main" in output assert "On branch main" in output
assert "No commits yet" in output assert "No commits yet" in output
assert ( assert (
@ -2594,7 +2595,7 @@ class TestProcessApi(BaseTest):
) )
process_model_absolute_dir = os.path.join(bpmn_root, process_model_identifier) process_model_absolute_dir = os.path.join(bpmn_root, process_model_identifier)
output = os.popen("git status").read() # noqa: S605 output = GitService.run_shell_command_to_get_stdout(["git", "status"])
test_string = 'Untracked files:\n (use "git add <file>..." to include in what will be committed)\n\ttest_group' test_string = 'Untracked files:\n (use "git add <file>..." to include in what will be committed)\n\ttest_group'
assert test_string in output assert test_string in output
@ -2607,7 +2608,7 @@ class TestProcessApi(BaseTest):
assert "test_group/test_sub_group/hello_world/process_model.json" in output assert "test_group/test_sub_group/hello_world/process_model.json" in output
assert "test_group/test_sub_group/process_group.json" in output assert "test_group/test_sub_group/process_group.json" in output
output = os.popen("git status").read() # noqa: S605 output = GitService.run_shell_command_to_get_stdout(["git", "status"])
assert "On branch main" in output assert "On branch main" in output
assert "nothing to commit" in output assert "nothing to commit" in output
assert "working tree clean" in output assert "working tree clean" in output
@ -2620,7 +2621,7 @@ class TestProcessApi(BaseTest):
os.system("git checkout staging") os.system("git checkout staging")
output = os.popen("git status").read() # noqa: S605 output = GitService.run_shell_command_to_get_stdout(["git", "status"])
assert "On branch staging" in output assert "On branch staging" in output
assert "nothing to commit" in output assert "nothing to commit" in output
assert "working tree clean" in output assert "working tree clean" in output
@ -2634,7 +2635,7 @@ class TestProcessApi(BaseTest):
os.system("git checkout main") os.system("git checkout main")
output = os.popen("git status").read() # noqa: S605 output = GitService.run_shell_command_to_get_stdout(["git", "status"])
assert "On branch main" in output assert "On branch main" in output
assert "nothing to commit" in output assert "nothing to commit" in output
assert "working tree clean" in output assert "working tree clean" in output
@ -2644,7 +2645,7 @@ class TestProcessApi(BaseTest):
with open(new_file_path, "wb") as f_open: with open(new_file_path, "wb") as f_open:
f_open.write(file_data) f_open.write(file_data)
output = os.popen("git status").read() # noqa: S605 output = GitService.run_shell_command_to_get_stdout(["git", "status"])
assert "On branch main" in output assert "On branch main" in output
assert "Untracked files:" in output assert "Untracked files:" in output
assert "test_group/test_sub_group/hello_world/new_file.txt" in output assert "test_group/test_sub_group/hello_world/new_file.txt" in output

View File

@ -536,7 +536,7 @@ export default function ProcessModelShow() {
onClose={() => setProcessModelPublished(false)} onClose={() => setProcessModelPublished(false)}
> >
<a href={prUrl} target="_void()"> <a href={prUrl} target="_void()">
view the changes and create a Pull Request View the changes and create a Pull Request
</a> </a>
</Notification> </Notification>
); );