|
| 1 | +#!/usr/bin/env python |
| 2 | + |
| 3 | +""" |
| 4 | +When squirrels get together for a party, they like to have cigars. |
| 5 | +A squirrel party is successful when the number of cigars is between |
| 6 | +40 and 60, inclusive. Unless it is the weekend, in which case there |
| 7 | +is no upper bound on the number of cigars. |
| 8 | +
|
| 9 | +Return True if the party with the given values is successful, |
| 10 | +or False otherwise. |
| 11 | +""" |
| 12 | + |
| 13 | + |
| 14 | +# you can change this import to test different versions |
| 15 | +from cigar_party import cigar_party |
| 16 | +# from cigar_party import cigar_party2 as cigar_party |
| 17 | +# from cigar_party import cigar_party3 as cigar_party |
| 18 | + |
| 19 | + |
| 20 | +def test_1(): |
| 21 | + assert cigar_party(30, False) is False |
| 22 | + |
| 23 | + |
| 24 | +def test_2(): |
| 25 | + assert cigar_party(50, False) is True |
| 26 | + |
| 27 | + |
| 28 | +def test_3(): |
| 29 | + assert cigar_party(70, True) is True |
| 30 | + |
| 31 | + |
| 32 | +def test_4(): |
| 33 | + assert cigar_party(30, True) is False |
| 34 | + |
| 35 | + |
| 36 | +def test_5(): |
| 37 | + assert cigar_party(50, True) is True |
| 38 | + |
| 39 | + |
| 40 | +def test_6(): |
| 41 | + assert cigar_party(60, False) is True |
| 42 | + |
| 43 | + |
| 44 | +def test_7(): |
| 45 | + assert cigar_party(61, False) is False |
| 46 | + |
| 47 | + |
| 48 | +def test_8(): |
| 49 | + assert cigar_party(40, False) is True |
| 50 | + |
| 51 | + |
| 52 | +def test_9(): |
| 53 | + assert cigar_party(39, False) is False |
| 54 | + |
| 55 | + |
| 56 | +def test_10(): |
| 57 | + assert cigar_party(40, True) is True |
| 58 | + |
| 59 | + |
| 60 | +def test_11(): |
| 61 | + assert cigar_party(39, True) is False |
0 commit comments