def test_generate(self):
        """
        Test the generate function
        """
        self.test_add_line_to_index()
        generated = generate(self.client, prefix=self.prefix, max_words=3)
        assert len(generated) >= 2
        assert len(generated) <= 3
        generated = generate(self.client, seed=['ate','one'], prefix=self.prefix, max_words=3)
        assert generated[2] == 'peach'
        assert 'sandwich' not in generated

        #test that relevant terms will be chosen when the relevant_terms argument is passed in
        generated = generate(self.client, relevant_terms=["peach",], prefix=self.prefix)       
        assert 'peach' in generated
        generated = generate(self.client, relevant_terms=["sandwich",], prefix=self.prefix)
        assert generated in 'sandwich'

        #there are no pizza keys!
        generated = generate(self.client, relevant_terms=["pizza",], prefix=self.prefix)
        assert len(generated) == 0
dataset/ETHPy150Open wieden-kennedy/python-markov/markov/tests.py/TestMarkovFunctions.test_generate/swapped operands of `in`