Support calling positional arguments by keyword (fix #998) (#2081)

This commit is contained in:
Adam Gleave
2018-05-17 16:10:26 -07:00
committed by Robert Nishihara
parent afbb260ca4
commit 470887c2ad
4 changed files with 47 additions and 40 deletions
+6
View File
@@ -57,6 +57,9 @@ class ActorAPI(unittest.TestCase):
self.assertEqual(
ray.get(actor.get_values.remote(0, arg2="d", arg1=0)),
(1, 2, "cd"))
self.assertEqual(
ray.get(actor.get_values.remote(arg2="d", arg1=0, arg0=2)),
(3, 2, "cd"))
# Make sure we get an exception if the constructor is called
# incorrectly.
@@ -66,6 +69,9 @@ class ActorAPI(unittest.TestCase):
with self.assertRaises(Exception):
actor = Actor.remote(0, 1, 2, arg3=3)
with self.assertRaises(Exception):
actor = Actor.remote(0, arg0=1)
# Make sure we get an exception if the method is called incorrectly.
actor = Actor.remote(1)
with self.assertRaises(Exception):