Exemple #1
0
 def testJsonOutput(self):
     returnObj = self.makeFakeObject()
     args = self.FakeArgs('json')
     runner = cli.AbstractGetRunner(args)
     runner._method = mock.Mock(return_value=returnObj)
     printCalls = self._getRunPrintMethodCalls(runner)
     self.assertEqual(json.loads(printCalls[0][0][0])['name'], 'name')
Exemple #2
0
 def testTextOutput(self):
     returnObj = self.makeFakeObject()
     args = self.FakeArgs()
     runner = cli.AbstractGetRunner(args)
     runner._method = mock.Mock(return_value=returnObj)
     printCalls = self._getRunPrintMethodCalls(runner)
     self.assertEqual(printCalls, [((u'id', u'name'), {'sep': u'\t'})])