Reload configuration when branches are created or deleted

The creation or deletion of branches can have a substantial impact
on Zuul's configuration.  Ensure that we update the config (for
the impacted project) whenever a branch is created or deleted.

Change-Id: Id675e8a4e82294a7aa41ee18630a5e2ca80b0790
diff --git a/tests/base.py b/tests/base.py
index 028a8b1..680c2a7 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -481,6 +481,25 @@
         self.changes[self.change_number] = c
         return c
 
+    def getFakeBranchCreatedEvent(self, project, branch):
+        path = os.path.join(self.upstream_root, project)
+        repo = git.Repo(path)
+        oldrev = 40 * '0'
+
+        event = {
+            "type": "ref-updated",
+            "submitter": {
+                "name": "User Name",
+            },
+            "refUpdate": {
+                "oldRev": oldrev,
+                "newRev": repo.heads[branch].commit.hexsha,
+                "refName": branch,
+                "project": project,
+            }
+        }
+        return event
+
     def review(self, project, changeid, message, action):
         number, ps = changeid.split(',')
         change = self.changes[int(number)]