Skip to content

Commit

Permalink
add shell test
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWang1127 committed May 9, 2024
1 parent 608c155 commit 509c792
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions library_generation/test/utilities_unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,30 @@ def test_sh_util_nonexistent_function_fails(self):
with self.assertRaises(RuntimeError):
result = util.sh_util("nonexistent_function")

def test_mv_src_files_sample_suffix_io_succeeds(self):
previous_dir = os.getcwd()
os.chdir(f"{resources_dir}/test_mv_src")
util.sh_util("mv_src_files samples main destination io")
self.assertTrue(
os.path.isfile(
"destination/samples/snippets/generated/io/example_io_sample.txt"
)
)
shutil.rmtree("destination/samples")
os.chdir(previous_dir)

def test_mv_src_files_sample_suffix_com_succeeds(self):
previous_dir = os.getcwd()
os.chdir(f"{resources_dir}/test_mv_src")
util.sh_util("mv_src_files samples main destination")
self.assertTrue(
os.path.isfile(
"destination/samples/snippets/generated/com/example_com_sample.txt"
)
)
shutil.rmtree("destination/samples")
os.chdir(previous_dir)

def test_eprint_valid_input_succeeds(self):
test_input = "This is some test input"
# create a stdio capture object
Expand Down

0 comments on commit 509c792

Please sign in to comment.