Skip to content

Instantly share code, notes, and snippets.

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]()
@bmihaylov
bmihaylov / tests.py
Last active August 29, 2015 13:57
Tests for the third homework of the Programming with Python course @ FMI
import unittest
import random
from solution import Card, RANKS, SUITS, CardCollection
from solution import StandardDeck, BeloteDeck, SixtySixDeck
Card.__hash__ = lambda self: 1
@mitko0003
mitko0003 / BrutalAnagrams.py
Last active August 29, 2015 13:57
It is as epic as it gets!
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"
@brodafly
brodafly / test_narcis.py
Last active August 29, 2015 13:57
A few tests to for the is_narcissistic() function
import unittest
import solution
class TestIsNarcissistic(unittest.TestCase):
def test_is_narcissistic(self):
self.assertFalse(
@antonionikolov
antonionikolov / is_pangram.py
Last active August 29, 2015 13:57
is_pangram test
import unittest
import solution
class TestFiveFunctions(unittest.TestCase):
def test_is_pangram(self):
self.assertFalse(
solution.is_pangram('Малката пухкава панда яде бамбук.'))
@GerganaPetrova
GerganaPetrova / gist:9481236
Last active August 29, 2015 13:57
happy_numbers_test
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)
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',
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'])