Ejemplo n.º 1
0
 def test_complains_if_recipients_isnt_a_list_or_string(self):
     with a_temp_directory() as backup_dir:
         for recipients in (0, 1, {}, {1: 1}, False, True, lambda: 1):
             with self.assertRaisesRegexp(
                     CommandError,
                     "Recipients list needs to be a list of strings.+"):
                 self.command.validate_options(backup_dir, recipients)
Ejemplo n.º 2
0
 def test_complains_if_backup_dir_doesnt_exist(self):
     with a_temp_directory() as backup_dir:
         shutil.rmtree(backup_dir)
         with self.assertRaisesRegexp(
                 CommandError,
                 "Specified backup_dir \({0}\) doesn't exist".format(
                     backup_dir)):
             self.command.validate_options(backup_dir, [])
Ejemplo n.º 3
0
 def test_complains_if_recipients_isnt_a_list_or_string(self):
     with a_temp_directory() as backup_dir:
         for recipients in (0, 1, {}, {1: 1}, False, True, lambda: 1):
             with self.assertRaisesRegexp(CommandError, "Recipients list needs to be a list of strings.+"):
                 self.command.validate_options(backup_dir, recipients)
Ejemplo n.º 4
0
 def test_complains_if_no_recipients(self):
     with a_temp_directory() as backup_dir:
         with self.assertRaisesRegexp(CommandError, "No recipients list has been specified.+"):
             self.command.validate_options(backup_dir, None)
Ejemplo n.º 5
0
 def test_complains_if_backup_dir_doesnt_exist(self):
     with a_temp_directory() as backup_dir:
         shutil.rmtree(backup_dir)
         with self.assertRaisesRegexp(CommandError, "Specified backup_dir \({0}\) doesn't exist".format(backup_dir)):
             self.command.validate_options(backup_dir, [])
Ejemplo n.º 6
0
 def test_complains_if_no_recipients(self):
     with a_temp_directory() as backup_dir:
         with self.assertRaisesRegexp(
                 CommandError, "No recipients list has been specified.+"):
             self.command.validate_options(backup_dir, None)