git cl: add reviewers and ccs to git push command if possible.

Also fix a typo in ValidateEmail function which didn't support
email addresses with '-' in them, e.g., infra-dev@chromium.org.

R=ehmaldonado

Bug: 875089
Change-Id: I2d73c1473527c9bf62e25e9f88250196b783fcb0
Reviewed-on: https://chromium-review.googlesource.com/c/1242849
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py
index 0c1ab86..bf91e45 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -1020,9 +1020,18 @@
         sorted(reviewers) + ['joe@example.com',
         'chromium-reviews+test-more-cc@chromium.org'] + cc),
        {
-         # TODO(tandrii): add here some valid accounts and make use of them.
+         e: {'email': e}
+         for e in (reviewers + ['joe@example.com'] + cc)
        }),
     ]
+    for r in sorted(reviewers):
+      if r != 'bad-account-or-email':
+        ref_suffix  += ',r=%s' % r
+        reviewers.remove(r)
+    for c in sorted(['joe@example.com'] + cc):
+      ref_suffix += ',cc=%s' % c
+      if c in cc:
+        cc.remove(c)
 
     calls.append((
       (['git', 'push',
@@ -1057,8 +1066,9 @@
           (('AddReviewers',
             'chromium-review.googlesource.com', 'my%2Frepo~123456',
             sorted(reviewers),
-            ['joe@example.com', 'chromium-reviews+test-more-cc@chromium.org'] +
-            cc, notify), ''),
+            cc + ['chromium-reviews+test-more-cc@chromium.org'],
+            notify),
+           ''),
       ]
     if tbr:
       calls += [