'Check that plugins get called'

def test_call(self):

    self._load_test_plugin('test.py', 'call.py')
    plugins = self.site.plugin_manager.plugins
    plugin = plugins[0]
    self.assertEqual('plugin_call', plugin.plugin_name)
    self.site.build()
    self.assertEqual(1, len(plugin.preBuild.calls))
    self.assertEqual((self.site,), plugin.preBuild.calls[0]['args'])
    self.assertEqual(len(self.site.pages()), len(plugin.preBuildPage.calls))
    for call in plugin.preBuildPage.calls:
        self.assertIn(len(call['args']), (3, 4))
    self.assertEqual(len(self.site.pages()), len(plugin.postBuildPage.calls))
    self.assertEqual(1, len(plugin.postBuild.calls))
    self.assertEqual((self.site,), plugin.postBuild.calls[0]['args'])
