def test_exit(self): """ Test the result and effect of the exit method for the context manager. """ client = ProxyKmipClient() client.__enter__() self.assertTrue(client._is_open) client.__exit__(None, None, None) self.assertFalse(client._is_open)
def test_enter(self): """ Test the result and effect of the enter method for the context manager. """ client = ProxyKmipClient() self.assertFalse(client._is_open) result = client.__enter__() self.assertEqual(result, client) self.assertTrue(client._is_open)