How to test rasa core from a python file

How to test rasa core from a python file like the following code:

from rasa.core.test import test

path_to_test_data = ‘/Users/saramohamadi/Desktop/Got_It/rasa/rasa_for_beginners_improve/tests/test_stories.yml’

unpacked_model = ‘/Users/saramohamadi/Desktop/Got_It/rasa/rasa_for_beginners_improve/models/20210118-141502/core’

test_result = test(path_to_test_data, unpacked_model) print(test_result)

Could you explain me the correct syntax? the above code does not work for me