Skip to content

Commit 71eea7f

Browse files
Merge pull request #47 from HPCNow/main
Enabled all current tests in github actions
2 parents 0ffc44c + c7b4ae3 commit 71eea7f

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

Diff for: tests/test_config.py

+15-16
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ def test_set_shared_froster_shared_config_exist(self, mock_print, mock_input_con
503503
self.assertTrue(os.path.exists(archive_json_file_shared))
504504

505505

506-
# @patch('builtins.print')
506+
@patch('builtins.print')
507507
class TestConfigNIH(unittest.TestCase):
508508

509509
# Method executed before every test
@@ -541,7 +541,6 @@ def test_set_nih(self, mock_print, mock_input_confirm):
541541
check_ini_file(self, self.cfg.config_file,
542542
NIH_SECTION, 'is_nih', 'False')
543543

544-
545544
@patch('inquirer.confirm', side_effect=[True, True, False])
546545
@patch('inquirer.prompt', return_value={'shared_dir': SHARED_DIR})
547546
def test_set_nih_when_shared_config(self, mock_print, mock_input_confirm, mock_input_promp):
@@ -555,14 +554,15 @@ def test_set_nih_when_shared_config(self, mock_print, mock_input_confirm, mock_i
555554

556555
# Check that the configuration file was updated correctly
557556
check_ini_file(self, self.cfg.shared_config_file,
558-
NIH_SECTION, 'is_nih', 'True')
557+
NIH_SECTION, 'is_nih', 'True')
559558

560559
# Call set_user method
561560
self.assertTrue(self.cfg.set_nih())
562561

563562
# Check that the configuration file was updated correctly
564563
check_ini_file(self, self.cfg.shared_config_file,
565-
NIH_SECTION, 'is_nih', 'False')
564+
NIH_SECTION, 'is_nih', 'False')
565+
566566

567567
@patch('builtins.print')
568568
class TestConfigS3(unittest.TestCase):
@@ -670,7 +670,6 @@ def test_set_s3(self, mock_print, mock_input_list, mock_input_text):
670670
# Check the bucket was created
671671
self.assertIn(S3_BUCKET_NAME, s3_buckets)
672672

673-
674673
@patch('inquirer.list_input', side_effect=['+ Create new bucket', S3_STORAGE_CLASS])
675674
@patch('inquirer.text', side_effect=[S3_BUCKET_NAME, S3_ARCHIVE_DIR])
676675
@patch('inquirer.confirm', side_effect=[True])
@@ -686,13 +685,13 @@ def test_set_s3_when_shared_config(self, mock_print, mock_input_list, mock_input
686685

687686
# Check that the configuration files were updated correctly
688687
check_ini_file(self, self.cfg.shared_config_file,
689-
S3_SECTION, 'bucket_name', S3_BUCKET_NAME)
688+
S3_SECTION, 'bucket_name', S3_BUCKET_NAME)
690689

691690
check_ini_file(self, self.cfg.shared_config_file,
692-
S3_SECTION, 'archive_dir', S3_ARCHIVE_DIR)
691+
S3_SECTION, 'archive_dir', S3_ARCHIVE_DIR)
693692

694693
check_ini_file(self, self.cfg.shared_config_file,
695-
S3_SECTION, 'storage_class', S3_STORAGE_CLASS)
694+
S3_SECTION, 'storage_class', S3_STORAGE_CLASS)
696695

697696
# Check that the s3_init is set
698697
self.assertTrue(self.cfg.s3_init)
@@ -759,32 +758,32 @@ def test_set_s3_select_bucket(self, mock_print, mock_input_list, mock_input_text
759758
# # Check that the configuration files were updated correctly
760759
# check_ini_file(self, self.cfg.config_file,
761760
# 'SLURM', 'slurm_walltime_days', str(SLURM_WALLTIME_DAYS))
762-
761+
763762
# check_ini_file(self, self.cfg.config_file,
764763
# 'SLURM', 'slurm_walltime_hours', str(SLURM_WALLTIME_HOURS))
765-
764+
766765
# check_ini_file(self, self.cfg.config_file,
767766
# 'SLURM', 'slurm_partition', SLURM_PARTITION)
768-
767+
769768
# check_ini_file(self, self.cfg.config_file,
770769
# 'SLURM', 'slurm_qos', SLURM_QOS)
771-
770+
772771
# check_ini_file(self, self.cfg.config_file,
773772
# 'SLURM', 'slurm_lscratch', SLURM_LOCAL_SCRATCH)
774-
773+
775774
# check_ini_file(self, self.cfg.config_file,
776775
# 'SLURM', 'lscratch_mkdir', SLURM_SCRIPT_SCRATCH)
777-
776+
778777
# check_ini_file(self, self.cfg.config_file,
779778
# 'SLURM', 'lscratch_rmdir', SLURM_SCRIPT_TEARS_DOWN)
780-
779+
781780
# check_ini_file(self, self.cfg.config_file,
782781
# 'SLURM', 'lscratch_root', SLURM_ROOT)
783782

784783

785784
if __name__ == '__main__':
786785

787-
if False:
786+
if True:
788787
unittest.main(verbosity=2)
789788
else:
790789
suite = unittest.TestSuite()

0 commit comments

Comments
 (0)