-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
cce9026
commit 426f974
Showing
2 changed files
with
35 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import os | ||
import subprocess | ||
from typing import List, Optional, Union | ||
|
||
from pysqa import QueueAdapter | ||
|
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,34 @@ | ||
import unittest | ||
|
||
try: | ||
from executorlib.standalone.cache.queue import _pysqa_execute_command | ||
|
||
skip_pysqa_test = False | ||
except ImportError: | ||
skip_pysqa_test = True | ||
|
||
|
||
@unittest.skipIf( | ||
skip_pysqa_test, "pysqa is not installed, so the pysqa tests are skipped." | ||
) | ||
class TestPysqaExecuteCommand(unittest.TestCase): | ||
def test_pysqa_execute_command_echo(self): | ||
out = _pysqa_execute_command( | ||
commands=["echo", "test"], | ||
working_directory=None, | ||
split_output=True, | ||
shell=False, | ||
error_filename="pysqa.err", | ||
) | ||
self.assertEqual(len(out), 2) | ||
self.assertEqual("test", out[0]) | ||
|
||
def test_pysqa_execute_command_fail(self): | ||
with self.assertRaises(FileNotFoundError): | ||
_pysqa_execute_command( | ||
commands=["no/executable/available"], | ||
working_directory=None, | ||
split_output=True, | ||
shell=False, | ||
error_filename="pysqa.err", | ||
) |