New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Url fix #1258
Conversation
`rasa_nlu` was throwing errors when trying to load training data via url. This was due to a byte encoding error. Fixes issue #51
tests/base/test_training_data.py
Outdated
def test_url_data_format(): | ||
test_url = 'http://website-demo.rasa.com/api/default/data.json?api_token=e8c436157a24b007ed5cdc9ba4d062ed66c4f63d' | ||
r = requests.get(test_url) | ||
data = r.json() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to do the request right? can't we just put the value in data?
(the tests should be able to run as independent if possible, in this case this test would randomly start failing if, e.g. the demo is not available, is getting restarted, or if the token changed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was wondering about this. And actually now that I think about it some more, this doesn't actually test much besides whether the link is working. I'll come up with a better test.
@twhughes the |
tests/base/test_training_data.py
Outdated
} | ||
] | ||
}, | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think this additional second item adds anything to the test, does it? if not I'd remove one of the common examples and only keep one
tests/base/test_training_data.py
Outdated
}""" | ||
fname = utils.create_temporary_file(data.encode("utf-8"), suffix="_tmp_training_data.json") | ||
data = utils.read_json_file(fname) | ||
validate_rasa_nlu_data(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert data is not None
at the end or something like that
rasa_nlu was throwing errors when trying to load training data via url. This was due to a byte encoding error. Fixes issue
RasaHQ/rasa_platform#51
Proposed changes:
Status (please check what you already did):