Tests fileinput.isstdin() when fileinput._state is not None. Ensure that it invokes fileinput._state.isstdin() exactly once, returns whatever it returns, and does not modify fileinput._state to point to a different object.
(self)
| 823 | self.assertIsNone(fileinput._state) |
| 824 | |
| 825 | def test_state_is_not_None(self): |
| 826 | """Tests fileinput.isstdin() when fileinput._state is not None. |
| 827 | Ensure that it invokes fileinput._state.isstdin() exactly once, |
| 828 | returns whatever it returns, and does not modify fileinput._state |
| 829 | to point to a different object.""" |
| 830 | isstdin_retval = object() |
| 831 | instance = MockFileInput() |
| 832 | instance.return_values["isstdin"] = isstdin_retval |
| 833 | fileinput._state = instance |
| 834 | retval = fileinput.isstdin() |
| 835 | self.assertExactlyOneInvocation(instance, "isstdin") |
| 836 | self.assertIs(retval, isstdin_retval) |
| 837 | self.assertIs(fileinput._state, instance) |
| 838 | |
| 839 | class InvocationRecorder: |
| 840 |
nothing calls this directly
no test coverage detected