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')
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'})])