def test_keyword_save_item(valid_adapter): lib = Items(default_adapter=valid_adapter) item = lib.load_work_item("test-ws", "second-item") MockAdapter.validate(item, "username", "another") item.data["username"] = "******" lib.save_work_item() MockAdapter.validate(item, "username", "changed")
def test_no_active_item(self, ): library = Items(default_adapter=MockAdapter) assert library.current is None with pytest.raises(AssertionError) as err: library.save_work_item() assert str(err.value) == "No active work item"
def test_keyword_save_work_item(valid_adapter): lib = Items(default_adapter=valid_adapter) item = lib.load_work_item("workspace-id", "workitem-id-second") MockAdapter.validate(item, "variables", VARIABLES_SECOND) modified = {"username": "******", "address": "*****@*****.**"} item.data["variables"] = modified lib.save_work_item() MockAdapter.validate(item, "variables", modified)