'The ``loader`` supplied to ``lazy_loading_proxy_for_interface`` is only
called once and all method calls are dispatched to the object it
returns.'

def test_loader_called_once(self):

    loader_called = []
    wrapped = AnImplementation()
    def loader():
        loader_called.append(True)
        return wrapped
    proxy = lazy_loading_proxy_for_interface(interface=AnInterface, loader=loader)
    self.assertEqual(([], [], []), (loader_called, wrapped.method_a_called, wrapped.method_b_called))
    proxy.method_a()
    proxy.method_b()
    self.assertEqual(([True], [True], [True]), (loader_called, wrapped.method_a_called, wrapped.method_b_called))
