@@ -538,3 +538,39 @@ def test_corrupt_correctness_2(self):
538
538
539
539
# Clean after yourself
540
540
self .del_test_dir (module_name , fname )
541
+
542
+ # @unittest.skip("skip")
543
+ # @unittest.expectedFailure
544
+ def test_color_with_no_terminal (self ):
545
+ """backup.control contains invalid option"""
546
+ fname = self .id ().split ('.' )[3 ]
547
+ backup_dir = os .path .join (self .tmp_path , module_name , fname , 'backup' )
548
+ node = self .make_simple_node (
549
+ base_dir = os .path .join (module_name , fname , 'node' ),
550
+ initdb_params = ['--data-checksums' ],
551
+ pg_options = {'autovacuum' : 'off' })
552
+
553
+ self .init_pb (backup_dir )
554
+ self .add_instance (backup_dir , 'node' , node )
555
+ node .slow_start ()
556
+
557
+ node .pgbench_init (scale = 1 )
558
+
559
+ # FULL
560
+ try :
561
+ self .backup_node (
562
+ backup_dir , 'node' , node , options = ['--color' , '--archive-timeout=1s' ])
563
+ # we should die here because exception is what we expect to happen
564
+ self .assertEqual (
565
+ 1 , 0 ,
566
+ "Expecting Error because archiving is disabled\n "
567
+ "Output: {0} \n CMD: {1}" .format (
568
+ repr (self .output ), self .cmd ))
569
+ except ProbackupException as e :
570
+ self .assertNotIn (
571
+ '[0m' , e .message ,
572
+ '\n Unexpected Error Message: {0}\n CMD: {1}' .format (
573
+ repr (e .message ), self .cmd ))
574
+
575
+ # Clean after yourself
576
+ self .del_test_dir (module_name , fname )
0 commit comments