コード例 #1
0
ファイル: configtest.py プロジェクト: JuanCarlosM/snap
 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
コード例 #2
0
ファイル: configtest.py プロジェクト: russellb/snap
 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
コード例 #3
0
ファイル: configtest.py プロジェクト: JuanCarlosM/snap
 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
コード例 #4
0
ファイル: configtest.py プロジェクト: JuanCarlosM/snap
 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
コード例 #5
0
ファイル: configtest.py プロジェクト: russellb/snap
 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