def test_dicts_from_stdin_single_json(self, stdin): stdin.isatty = lambda: False dicts = iter(dicts_from_stdin()) d1 = next(dicts) self.assertEqual({"name": "n1"}, d1) self.assertRaises(StopIteration, next, dicts)
def test_dicts_from_json_list_of_obj(self, stdin): dicts = iter(dicts_from_stdin()) d1 = next(dicts) d2 = next(dicts) self.assertEqual({"name": "n1"}, d1) self.assertEqual({"name": "n2"}, d2) self.assertRaises(StopIteration, next, dicts)