Testing the Output
00:00
In the previous lesson you added persisting the index to your code, so now it’s time to test it. So go to your terminal and run policy_bot.py.
00:13 And so you can see here as part of the output that the index has been created and persisted to storage. And to test the bot, I’m going to paste in a prompt.
00:24
"Can I show off my new baseball cap in the office on Monday?" So I don’t have to add, hey, I work for Steven’s Pythonistas Limited, at the start of it, and I also don’t have to add, please explain why, because that has been added to the code automatically while you were doing the refactoring, you might remember.
00:44 and note, I cannot show off my new baseball cap in the office on Monday because staff are not allowed to wear a hat in the office according to the company policy.
00:52 So yeah, that still works. The final thing to check then is that if you run this again, does it then indeed load the index from storage, and there you go, so the index has been loaded from storage.
01:06 And then the final thing to do is to check that indeed this still works when the index has been loaded from storage. So we ask a question about cursing, and I broke the second rule, swearing is not allowed and will result in a fine of a one US dollar contribution to the swear box.
01:24 So now you have a fully functioning example, one that does indeed store the index, and then the question is, what are your next steps, and so you’ll be covering that in the next lessons.
Become a Member to join the conversation.
