offline test: dargs in test_spec can be obmitted

If an element in test_spec does not have 'dargs', an empty dict object
will be used.

BUG=chromium:573933
TEST=make test

Change-Id: I717afafaa32b52202f29ea40b24445cae53b5a3f
Reviewed-on: https://chromium-review.googlesource.com/324911
Commit-Ready: Wei-Han Chen <stimim@chromium.org>
Tested-by: Wei-Han Chen <stimim@chromium.org>
Reviewed-by: Chih-Yu Huang <akahuang@chromium.org>
diff --git a/py/test/pytests/offline_test/shell/deploy.py b/py/test/pytests/offline_test/shell/deploy.py
index 8c30ccd..258f34f 100644
--- a/py/test/pytests/offline_test/shell/deploy.py
+++ b/py/test/pytests/offline_test/shell/deploy.py
@@ -244,10 +244,11 @@
       raise OfflineTestError('failed to make dut:%s writable' % factory_root)
 
     for spec in self.args.test_spec:
+      dargs = spec.get('dargs', {})
       if 'shtest_name' in spec:
-        self.builder.AddShellTestCase(spec['shtest_name'], **spec['dargs'])
+        self.builder.AddShellTestCase(spec['shtest_name'], **dargs)
       elif 'pytest_name' in spec:
-        self.builder.AddPythonTestCase(spec['pytest_name'], **spec['dargs'])
+        self.builder.AddPythonTestCase(spec['pytest_name'], **dargs)
       else:
         raise ValueError('You must specify one of `shtest_name` and '
                          '`pytest_name`')