Last active
August 10, 2017 15:43
-
-
Save robvanderleek/3410c76aae76b87c5c1e4563c12c4284 to your computer and use it in GitHub Desktop.
Test case for generator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from buzz import generator | |
def test_sample_single_word(): | |
l = ('foo', 'bar', 'foobar') | |
word = generator.sample(l) | |
assert word in l | |
def test_sample_multiple_words(): | |
l = ('foo', 'bar', 'foobar') | |
words = generator.sample(l, 2) | |
assert len(words) == 2 | |
assert words[0] in l | |
assert words[1] in l | |
assert words[0] is not words[1] | |
def test_generate_buzz_of_at_least_five_words(): | |
phrase = generator.generate_buzz() | |
assert len(phrase.split()) >= 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ImportError while importing test module /cicd-buzz/tests/test_generator.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test_generator.py:3: in
from buzz import generator
E ImportError: No module named buzz