@@ -503,7 +503,7 @@ def test_set_shared_froster_shared_config_exist(self, mock_print, mock_input_con
503
503
self .assertTrue (os .path .exists (archive_json_file_shared ))
504
504
505
505
506
- # @patch('builtins.print')
506
+ @patch ('builtins.print' )
507
507
class TestConfigNIH (unittest .TestCase ):
508
508
509
509
# Method executed before every test
@@ -541,7 +541,6 @@ def test_set_nih(self, mock_print, mock_input_confirm):
541
541
check_ini_file (self , self .cfg .config_file ,
542
542
NIH_SECTION , 'is_nih' , 'False' )
543
543
544
-
545
544
@patch ('inquirer.confirm' , side_effect = [True , True , False ])
546
545
@patch ('inquirer.prompt' , return_value = {'shared_dir' : SHARED_DIR })
547
546
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
555
554
556
555
# Check that the configuration file was updated correctly
557
556
check_ini_file (self , self .cfg .shared_config_file ,
558
- NIH_SECTION , 'is_nih' , 'True' )
557
+ NIH_SECTION , 'is_nih' , 'True' )
559
558
560
559
# Call set_user method
561
560
self .assertTrue (self .cfg .set_nih ())
562
561
563
562
# Check that the configuration file was updated correctly
564
563
check_ini_file (self , self .cfg .shared_config_file ,
565
- NIH_SECTION , 'is_nih' , 'False' )
564
+ NIH_SECTION , 'is_nih' , 'False' )
565
+
566
566
567
567
@patch ('builtins.print' )
568
568
class TestConfigS3 (unittest .TestCase ):
@@ -670,7 +670,6 @@ def test_set_s3(self, mock_print, mock_input_list, mock_input_text):
670
670
# Check the bucket was created
671
671
self .assertIn (S3_BUCKET_NAME , s3_buckets )
672
672
673
-
674
673
@patch ('inquirer.list_input' , side_effect = ['+ Create new bucket' , S3_STORAGE_CLASS ])
675
674
@patch ('inquirer.text' , side_effect = [S3_BUCKET_NAME , S3_ARCHIVE_DIR ])
676
675
@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
686
685
687
686
# Check that the configuration files were updated correctly
688
687
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 )
690
689
691
690
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 )
693
692
694
693
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 )
696
695
697
696
# Check that the s3_init is set
698
697
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
759
758
# # Check that the configuration files were updated correctly
760
759
# check_ini_file(self, self.cfg.config_file,
761
760
# 'SLURM', 'slurm_walltime_days', str(SLURM_WALLTIME_DAYS))
762
-
761
+
763
762
# check_ini_file(self, self.cfg.config_file,
764
763
# 'SLURM', 'slurm_walltime_hours', str(SLURM_WALLTIME_HOURS))
765
-
764
+
766
765
# check_ini_file(self, self.cfg.config_file,
767
766
# 'SLURM', 'slurm_partition', SLURM_PARTITION)
768
-
767
+
769
768
# check_ini_file(self, self.cfg.config_file,
770
769
# 'SLURM', 'slurm_qos', SLURM_QOS)
771
-
770
+
772
771
# check_ini_file(self, self.cfg.config_file,
773
772
# 'SLURM', 'slurm_lscratch', SLURM_LOCAL_SCRATCH)
774
-
773
+
775
774
# check_ini_file(self, self.cfg.config_file,
776
775
# 'SLURM', 'lscratch_mkdir', SLURM_SCRIPT_SCRATCH)
777
-
776
+
778
777
# check_ini_file(self, self.cfg.config_file,
779
778
# 'SLURM', 'lscratch_rmdir', SLURM_SCRIPT_TEARS_DOWN)
780
-
779
+
781
780
# check_ini_file(self, self.cfg.config_file,
782
781
# 'SLURM', 'lscratch_root', SLURM_ROOT)
783
782
784
783
785
784
if __name__ == '__main__' :
786
785
787
- if False :
786
+ if True :
788
787
unittest .main (verbosity = 2 )
789
788
else :
790
789
suite = unittest .TestSuite ()
0 commit comments