Skip to content

Instantly share code, notes, and snippets.

@aleybe
Last active December 26, 2019 06:27
Show Gist options
  • Save aleybe/c9bebe9ee147d45c6728d39379483bbb to your computer and use it in GitHub Desktop.
Save aleybe/c9bebe9ee147d45c6728d39379483bbb to your computer and use it in GitHub Desktop.
tests_random_words_function_blog
import unittest
import function_library as fl
class Test_FunctionLibrary(unittest.TestCase):
"""
Test function library in here
"""
def test_random_words(self):
"""
Test random word function here
"""
# put your test logic in here
# need string for the function to grab random words from
example_string = "Rick Sanchez and Morty Smith go on another adventure!"
output_list = fl.create_rick_and_morty_adventure(example_string)
# test if the output is a list
self.assertIsInstance(output_list, list)
# test the output has a lenght of 3
self.assertEqual(len(output_list), 3)
if __name__ == "__main__":
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment