Example #1
0
 def testValidateMode(self):
     # ensure that if mode is not set, exception is thrown
     config = snap.config.Config()
     with self.assertRaises(snap.exceptions.ArgError) as context:
         config.verify_integrity()
     self.assertEqual(context.exception.message, 'Must specify backup or restore')
     pass
Example #2
0
 def testValidateMode(self):
     # ensure that if mode is not set, exception is thrown
     config = snap.config.Config()
     with self.assertRaises(snap.exceptions.ArgError) as context:
         config.verify_integrity()
     self.assertEqual(context.exception.message,
                      'Must specify backup or restore')
     pass
Example #3
0
 def testValidateRestoreSnapFile(self):
     # ensure that if snapfile is not set, error is thrown
     snap.config.options.mode = snap.config.ConfigOptions.RESTORE
     snap.config.options.snapfile = None
     config = snap.config.Config()
     with self.assertRaises(snap.exceptions.ArgError) as context:
         config.verify_integrity()
     self.assertEqual(context.exception.message, 'Must specify snapfile')
     pass
Example #4
0
 def testValidateOutputFormat(self):
     # ensure that if outputformat is not specified, exception is thrown
     snap.config.options.mode = snap.config.ConfigOptions.BACKUP
     snap.config.options.outputformat = None
     config = snap.config.Config()
     with self.assertRaises(snap.exceptions.ArgError) as context:
         config.verify_integrity()
     self.assertEqual(context.exception.message, 'Must specify valid output format')
     pass
Example #5
0
 def testValidateRestoreSnapFile(self):
     # ensure that if snapfile is not set, error is thrown
     snap.config.options.mode = snap.config.ConfigOptions.RESTORE
     snap.config.options.snapfile = None
     config = snap.config.Config()
     with self.assertRaises(snap.exceptions.ArgError) as context:
         config.verify_integrity()
     self.assertEqual(context.exception.message, 'Must specify snapfile')
     pass