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 | |
import collections | |
from solution import (RANKS, SUITS, Card, CardCollection, | |
StandardDeck, SixtySixDeck, BeloteDeck) | |
class RankTest(unittest.TestCase): | |
def setUp(self): | |
self.rank_string = 'Three' | |
self.rank = RANKS[self.rank_string]() |
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 | |
import random | |
from solution import Card, RANKS, SUITS, CardCollection | |
from solution import StandardDeck, BeloteDeck, SixtySixDeck | |
Card.__hash__ = lambda self: 1 | |
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 | |
import solution | |
class TestFiveFunctions(unittest.TestCase): | |
def test_anagrams_0(self): | |
words = [("To be or not to be: that is the question; whether" | |
" \'tis nobler in the mind to suffer the slings and arrows" |
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 | |
import solution | |
class TestIsNarcissistic(unittest.TestCase): | |
def test_is_narcissistic(self): | |
self.assertFalse( |
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 | |
import solution | |
class TestFiveFunctions(unittest.TestCase): | |
def test_is_pangram(self): | |
self.assertFalse( | |
solution.is_pangram('Малката пухкава панда яде бамбук.')) |
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 solution import is_happy, happy_primes | |
class TestHappy(unittest.TestCase): | |
def test_is_happy7(self): | |
self.assertEqual(is_happy(7), True) | |
def test_is_happy10(self): | |
self.assertEqual(is_happy(10), True) |
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 solution import wow_such_much | |
class TestDoge(unittest.TestCase): | |
def test_suchmuch_from_15_to_negative(self): | |
self.assertEqual( | |
wow_such_much(15, -3), | |
['suchmuch', '14', '13', 'such', '11', 'much', 'such', '8', '7', 'such', |
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 solution import wow_such_much, count_doge_words | |
class TestDoge(unittest.TestCase): | |
def test_suchmuch_from_negative(self): | |
self.assertEqual(wow_such_much(-5, 7), | |
['much', '-4', 'such', '-2', '-1', 'suchmuch', '1', '2', 'such', '4', 'much', 'such']) | |