fix: Goal state pickling/unpickling
This commit is contained in:
parent
fb8652d132
commit
f1e3ec82f0
|
@ -314,15 +314,20 @@ class Server:
|
||||||
})
|
})
|
||||||
if "error" in result:
|
if "error" in result:
|
||||||
raise ServerError(result["desc"])
|
raise ServerError(result["desc"])
|
||||||
def goal_load(self, path: str) -> int:
|
def goal_load(self, path: str) -> GoalState:
|
||||||
# FIXME: Load the entire state
|
|
||||||
result = self.run('goal.load', {
|
result = self.run('goal.load', {
|
||||||
"path": path,
|
"path": path,
|
||||||
})
|
})
|
||||||
if "error" in result:
|
if "error" in result:
|
||||||
raise ServerError(result["desc"])
|
raise ServerError(result["desc"])
|
||||||
state_id = result['id']
|
state_id = result['id']
|
||||||
return state_id
|
result = self.run('goal.print', {
|
||||||
|
'stateId': state_id,
|
||||||
|
'goals': True,
|
||||||
|
})
|
||||||
|
if "error" in result:
|
||||||
|
raise ServerError(result["desc"])
|
||||||
|
return GoalState.parse(result, self.to_remove_goal_states)
|
||||||
|
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
|
@ -336,7 +341,7 @@ def get_version():
|
||||||
class TestServer(unittest.TestCase):
|
class TestServer(unittest.TestCase):
|
||||||
|
|
||||||
def test_version(self):
|
def test_version(self):
|
||||||
self.assertEqual(get_version(), "0.2.22")
|
self.assertEqual(get_version(), "0.2.23")
|
||||||
|
|
||||||
def test_expr_type(self):
|
def test_expr_type(self):
|
||||||
server = Server()
|
server = Server()
|
||||||
|
|
2
src
2
src
|
@ -1 +1 @@
|
||||||
Subproject commit 5d76626912795579832f2bb43748e137bb6d0595
|
Subproject commit 3744cfaa9608cd43e00078283339662b3720949b
|
Loading…
Reference in New Issue