xBuddy local vs remote path handling.

Explicitly check for local/remote in the xBuddy path and check for
and properly direct local requests.

Plus other bug fixes:
  - better defaults for paths
  - remove "latest-local" and use xbuddy/local/{b}/latest/{a} instead.

BUG=chromium:261667,256461
TEST=unittests, manual

Change-Id: I1baa7e6eab86249ab50d1e02a084ef1cdbf2fc98
Reviewed-on: https://gerrit.chromium.org/gerrit/62706
Reviewed-by: Ryan Cui <rcui@chromium.org>
Commit-Queue: Joy Chen <joychen@chromium.org>
Reviewed-by: Joy Chen <joychen@chromium.org>
Tested-by: Joy Chen <joychen@chromium.org>
diff --git a/xbuddy_unittest.py b/xbuddy_unittest.py
index fabe411..9c37653 100644
--- a/xbuddy_unittest.py
+++ b/xbuddy_unittest.py
@@ -104,22 +104,36 @@
   def testBasicInterpretPath(self):
     """Basic checks for splitting a path"""
     path = ('parrot', 'R27-2455.0.0', 'test')
-    expected = ('test', 'parrot', 'R27-2455.0.0')
+    expected = ('test', 'parrot', 'R27-2455.0.0', False)
     self.assertEqual(self.mock_xb._InterpretPath(path_list=path), expected)
 
     path = ('parrot', 'R27-2455.0.0', 'full_payload')
-    expected = ('full_payload', 'parrot', 'R27-2455.0.0')
+    expected = ('full_payload', 'parrot', 'R27-2455.0.0', False)
     self.assertEqual(self.mock_xb._InterpretPath(path_list=path), expected)
 
     path = ('parrot', 'R27-2455.0.0')
-    expected = ('test', 'parrot', 'R27-2455.0.0')
+    expected = ('test', 'parrot', 'R27-2455.0.0', False)
     self.assertEqual(self.mock_xb._InterpretPath(path_list=path), expected)
 
-    path = ('parrot', 'R27-2455.0.0', 'too', 'many', 'pieces')
+    path = ('remote', 'parrot', 'R27-2455.0.0')
+    expected = ('test', 'parrot', 'R27-2455.0.0', False)
+    self.assertEqual(self.mock_xb._InterpretPath(path_list=path), expected)
+
+    path = ('local', 'parrot', 'R27-2455.0.0')
+    expected = ('test', 'parrot', 'R27-2455.0.0', True)
+    self.assertEqual(self.mock_xb._InterpretPath(path_list=path), expected)
+
+    path = ()
     self.assertRaises(xbuddy.XBuddyException,
                       self.mock_xb._InterpretPath,
                       path_list=path)
 
+    path = ('local',)
+    self.assertRaises(xbuddy.XBuddyException,
+                      self.mock_xb._InterpretPath,
+                      path_list=path)
+
+
   def testTimestampsAndList(self):
     """Creation and listing of builds according to their timestamps."""
     # make 3 different timestamp files