ONOS-2399 Added checkLeaderChange() to FUNCintent dependencies. Implemented that function in CASE1000 of FUNCintent

Fixed formatting and added better error handling

Added return values

Fixed some formatting

Fixed more Formatting and added description of return behavior

Fixed mroe formatting

Change-Id: I147746cef7a7d9071bd90e5b67890cd2b310a193
diff --git a/TestON/tests/FUNCintent/FUNCintent.py b/TestON/tests/FUNCintent/FUNCintent.py
index 1e10db3..2c47b4f 100644
--- a/TestON/tests/FUNCintent/FUNCintent.py
+++ b/TestON/tests/FUNCintent/FUNCintent.py
@@ -347,6 +347,8 @@
         assert main.numSwitch, "Placed the total number of switch topology in \
                                 main.numSwitch"
 
+        intentLeadersOld = main.CLIs[ 0 ].leaderCandidates()
+
         main.case( "Add host intents between 2 host" )
 
         main.step( "IPV4: Add host intents between h1 and h9" )
@@ -446,6 +448,11 @@
                                  onfail="VLAN2: Add inter vlan host" +
                                         " intent failed" )
 
+
+        intentLeadersNew = main.CLIs[ 0 ].leaderCandidates()
+        main.intentFunction.checkLeaderChange( intentLeadersOld,
+                                                intentLeadersNew )
+
     def CASE2000( self, main ):
         """
             Add point intents between 2 hosts:
@@ -638,7 +645,7 @@
                                  actual=stepResult,
                                  onpass="DUALSTACK1: Add point intent" +
                                         " successful",
-                                 onfail="DUALSTACK1: Add point intent failed" ) 
+                                 onfail="DUALSTACK1: Add point intent failed" )
 
         main.step( "VLAN: Add point intents between h5 and h21" )
         stepResult = main.TRUE
@@ -803,7 +810,7 @@
                                  onpass="VLAN: Successfully added single point"
                                         + " to multi point intents",
                                  onfail="VLAN: Failed to add single point" +
-                                        " to multi point intents" ) 
+                                        " to multi point intents" )
 
     def CASE4000( self, main ):
         """