autotest: update version check for test-ap builds

Update regex to cover test-ap builds when checking image versions after
an update.  Also added unittest.

BUG=chromium:496868
TEST=ran network_WiFi_UpdateRouter test on DUT
TEST=python autoupdater_unittest.py

Change-Id: Ied31c18bfb087f40cd28729920d492a83dd81d22
Reviewed-on: https://chromium-review.googlesource.com/290436
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Rebecca Silberstein <silberst@chromium.org>
Trybot-Ready: Rebecca Silberstein <silberst@chromium.org>
Tested-by: Rebecca Silberstein <silberst@chromium.org>
diff --git a/client/common_lib/site_utils.py b/client/common_lib/site_utils.py
index 5216f16..a688395 100644
--- a/client/common_lib/site_utils.py
+++ b/client/common_lib/site_utils.py
@@ -426,7 +426,7 @@
 
     The method is designed to compare version for following 6 scenarios with
     samples of build version and expected release version:
-    1. trybot non-release build (paladin or pre-cq build).
+    1. trybot non-release build (paladin, pre-cq or test-ap build).
     build version:   trybot-lumpy-paladin/R27-3837.0.0-b123
     release version: 3837.0.2013_03_21_1340
 
@@ -476,8 +476,8 @@
     stripped_version = stripped_version.split('/')[-1]
 
     is_trybot_non_release_build = (
-            re.match(r'.*trybot-.+-(paladin|pre-cq)', build_version) or
-            re.match(r'.*trybot-.+-(paladin|pre-cq)', update_url))
+            re.match(r'.*trybot-.+-(paladin|pre-cq|test-ap)', build_version) or
+            re.match(r'.*trybot-.+-(paladin|pre-cq|test-ap)', update_url))
 
     # Replace date string with 0 in release_version
     release_version_no_date = re.sub(r'\d{4}_\d{2}_\d{2}_\d+', '0',