Exemple #1
0
 def showTaggedSuccessTest(self, mode):
     self.stealOutput()
     (flag, spec, o) = specify_DADGAD(mode, self.db.host)
     description = cli.describe_by_mode(o)
     args = (['show', '-U', '-v', flag, spec, 'rating', '/fluiddb/about']
             + self.hostname)
     cli.execute_command_line(*cli.parse_args(args))
     self.reset()
     self.assertEqual(self.out.buffer,
             ['Object %s:' % description, '\n',
              '  /%s/rating = 10' % self.user.encode('UTF-8'), '\n',
              '  /fluiddb/about = "DADGAD"', '\n'])
     self.assertEqual(self.err.buffer, [])
Exemple #2
0
 def untagTest(self, mode, verbose=True):
     self.stealOutput()
     (flag, spec, o) = specify_DADGAD(mode, self.db.host)
     description = cli.describe_by_mode(o)
     flags = ['-v', flag] if verbose else [flag]
     args = ['untag'] + ['-U'] + flags + [spec, 'rating'] + self.hostname
     cli.execute_command_line(*cli.parse_args(args))
     self.reset()
     if verbose:
         target = ['Removed tag rating from object %s\n' % description,
                   '\n']
     else:
         target = []
     self.assertEqual(self.out.buffer, target)
     self.assertEqual(self.err.buffer, [])
Exemple #3
0
 def tagTest(self, mode, verbose=True):
     self.stealOutput()
     (flag, spec, o) = specify_DADGAD(mode, self.db.host)
     description = cli.describe_by_mode(o)
     flags = ['-v', flag] if verbose else [flag]
     args = ['tag'] + ['-U'] + flags + [spec, 'rating=10'] + self.hostname
     cli.execute_command_line(*cli.parse_args(args))
     self.reset()
     if verbose:
         target = ['Tagged object %s with rating = 10' % description, '\n']
     else:
         if mode == 'query':
             target = ['1 object matched', '\n']
         else:
             target = []
     self.assertEqual(self.out.buffer, target)
     self.assertEqual(self.err.buffer, [])