Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_chain(self):
text_model = self.sherlock_model
chain_json = text_model.chain.to_json()
stored_chain = markovify.Chain.from_json(chain_json)
assert(get_sorted(stored_chain.to_json()) == get_sorted(chain_json))
new_text_model = markovify.Text.from_chain(chain_json)
assert(get_sorted(new_text_model.chain.to_json()) == get_sorted(chain_json))
sent = new_text_model.make_sentence()
assert(len(sent) != 0)