# How to test rasa core from a python file

**URL:** <https://forum.rasa.com/t/how-to-test-rasa-core-from-a-python-file/39652>\
**Category:** Rasa Open Source\
**Created:** [January 30, 2021, 10:47pm UTC](https://forum.rasa.com/t/how-to-test-rasa-core-from-a-python-file/39652 "2021-01-30T22:47:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![saramoha](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@saramoha](https://forum.rasa.com/u/saramoha)\
**Post date:** [January 30, 2021, 10:47pm UTC](https://forum.rasa.com/t/how-to-test-rasa-core-from-a-python-file/39652/1 "2021-01-30T22:47:05Z")

</div>

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
