def test_get_version(self, stub):
     version = "v0.0.1"
     obj = Int(1)
     wf = Workflow(id="[email protected]:test")
     assert len(wf._message.versioned_grafts) == 0
     wf.set_version(version, obj)
     assert len(wf._message.versioned_grafts) == 1
     assert wf._message.versioned_grafts[0].version == version
     vg = wf.get_version(version)
     assert vg.version == version
     assert type(vg.object) == type(obj)
 def test_get_version_raises_doesnt_exist(self, stub):
     version = "v0.0.1"
     wf = Workflow(id="[email protected]:test")
     with pytest.raises(KeyError):
         wf.get_version(version)
 def test_get_version_raises_wrong_type(self, stub):
     version = 5
     wf = Workflow(id="[email protected]:test")
     with pytest.raises(TypeError):
         wf.get_version(version)