Пример #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)
Пример #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, [])
Пример #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)
Пример #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)
Пример #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, [])
Пример #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)