-
-
Notifications
You must be signed in to change notification settings - Fork 457
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
Showing
63 changed files
with
487 additions
and
192 deletions.
There are no files selected for viewing
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
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,12 @@ | ||
[flake8] | ||
ignore = E501,W503,E722,E203 | ||
exclude = | ||
.mypy* | ||
.pytest* | ||
.git | ||
demo_data.py | ||
manage.py | ||
*/__pycache__/* | ||
*/env/* | ||
/usr/local/lib/* | ||
**/migrations/* |
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -540,6 +540,7 @@ def test_run_script(self, run_script, email_task): | |
"args": [], | ||
"timeout": 15, | ||
"run_as_user": False, | ||
"env_vars": ["hello=world", "foo=bar"], | ||
} | ||
|
||
r = self.client.post(url, data, format="json") | ||
|
@@ -555,6 +556,7 @@ def test_run_script(self, run_script, email_task): | |
wait=True, | ||
history_pk=hist.pk, | ||
run_as_user=False, | ||
env_vars=["hello=world", "foo=bar"], | ||
) | ||
run_script.reset_mock() | ||
|
||
|
@@ -567,6 +569,7 @@ def test_run_script(self, run_script, email_task): | |
"emailMode": "default", | ||
"emails": ["[email protected]", "[email protected]"], | ||
"run_as_user": False, | ||
"env_vars": ["hello=world", "foo=bar"], | ||
} | ||
r = self.client.post(url, data, format="json") | ||
self.assertEqual(r.status_code, 200) | ||
|
@@ -577,6 +580,7 @@ def test_run_script(self, run_script, email_task): | |
emails=[], | ||
args=["abc", "123"], | ||
run_as_user=False, | ||
env_vars=["hello=world", "foo=bar"], | ||
) | ||
email_task.reset_mock() | ||
|
||
|
@@ -591,6 +595,7 @@ def test_run_script(self, run_script, email_task): | |
emails=["[email protected]", "[email protected]"], | ||
args=["abc", "123"], | ||
run_as_user=False, | ||
env_vars=["hello=world", "foo=bar"], | ||
) | ||
|
||
# test fire and forget | ||
|
@@ -600,6 +605,7 @@ def test_run_script(self, run_script, email_task): | |
"args": ["hello", "world"], | ||
"timeout": 22, | ||
"run_as_user": True, | ||
"env_vars": ["hello=world", "foo=bar"], | ||
} | ||
|
||
r = self.client.post(url, data, format="json") | ||
|
@@ -614,6 +620,7 @@ def test_run_script(self, run_script, email_task): | |
timeout=25, | ||
history_pk=hist.pk, | ||
run_as_user=True, | ||
env_vars=["hello=world", "foo=bar"], | ||
) | ||
run_script.reset_mock() | ||
|
||
|
@@ -629,6 +636,7 @@ def test_run_script(self, run_script, email_task): | |
"custom_field": custom_field.pk, | ||
"save_all_output": True, | ||
"run_as_user": False, | ||
"env_vars": ["hello=world", "foo=bar"], | ||
} | ||
|
||
r = self.client.post(url, data, format="json") | ||
|
@@ -644,6 +652,7 @@ def test_run_script(self, run_script, email_task): | |
wait=True, | ||
history_pk=hist.pk, | ||
run_as_user=False, | ||
env_vars=["hello=world", "foo=bar"], | ||
) | ||
run_script.reset_mock() | ||
|
||
|
@@ -662,6 +671,7 @@ def test_run_script(self, run_script, email_task): | |
"custom_field": custom_field.pk, | ||
"save_all_output": False, | ||
"run_as_user": False, | ||
"env_vars": ["hello=world", "foo=bar"], | ||
} | ||
|
||
r = self.client.post(url, data, format="json") | ||
|
@@ -677,6 +687,7 @@ def test_run_script(self, run_script, email_task): | |
wait=True, | ||
history_pk=hist.pk, | ||
run_as_user=False, | ||
env_vars=["hello=world", "foo=bar"], | ||
) | ||
run_script.reset_mock() | ||
|
||
|
@@ -697,6 +708,7 @@ def test_run_script(self, run_script, email_task): | |
"custom_field": custom_field.pk, | ||
"save_all_output": False, | ||
"run_as_user": False, | ||
"env_vars": ["hello=world", "foo=bar"], | ||
} | ||
|
||
r = self.client.post(url, data, format="json") | ||
|
@@ -712,6 +724,7 @@ def test_run_script(self, run_script, email_task): | |
wait=True, | ||
history_pk=hist.pk, | ||
run_as_user=False, | ||
env_vars=["hello=world", "foo=bar"], | ||
) | ||
run_script.reset_mock() | ||
|
||
|
@@ -729,6 +742,7 @@ def test_run_script(self, run_script, email_task): | |
"args": ["hello", "world"], | ||
"timeout": 22, | ||
"run_as_user": False, | ||
"env_vars": ["hello=world", "foo=bar"], | ||
} | ||
|
||
r = self.client.post(url, data, format="json") | ||
|
@@ -744,6 +758,7 @@ def test_run_script(self, run_script, email_task): | |
wait=True, | ||
history_pk=hist.pk, | ||
run_as_user=False, | ||
env_vars=["hello=world", "foo=bar"], | ||
) | ||
run_script.reset_mock() | ||
|
||
|
@@ -1272,9 +1287,9 @@ def test_get_agent_history_permissions(self): | |
|
||
sites = baker.make("clients.Site", _quantity=2) | ||
agent = baker.make_recipe("agents.agent", site=sites[0]) | ||
history = baker.make("agents.AgentHistory", agent=agent, _quantity=5) | ||
history = baker.make("agents.AgentHistory", agent=agent, _quantity=5) # noqa | ||
unauthorized_agent = baker.make_recipe("agents.agent", site=sites[1]) | ||
unauthorized_history = baker.make( | ||
unauthorized_history = baker.make( # noqa | ||
"agents.AgentHistory", agent=unauthorized_agent, _quantity=6 | ||
) | ||
|
||
|
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
Oops, something went wrong.