コード例 #1
0
    def is_leap(self):
        with expect:
            is_leap(year) == expected_value

        with where:
            year | expected_value
            1993 | False
            1992 | True
            1900 | False
            2000 | True
コード例 #2
0
def test_scenarios(year):
    verify("is Leap " + str(year) + ": " + str(is_leap(year)),
           namer=get_scenario_namer(year))
コード例 #3
0
def test_leap_with_list():
    results = [(year, is_leap(year)) for year in [1993, 1992, 1900, 2000]]
    verify_all("(year, is leap year)", results)
コード例 #4
0
 def atypical_leap(self):
     with when:
         result = is_leap(2000)
     with then:
         result == True
コード例 #5
0
 def atypical_common(self):
     with when:
         result = is_leap(1900)
     with then:
         result == False
コード例 #6
0
 def typical_leap(self):
     with when:
         result = is_leap(1992)
     with then:
         result == True
コード例 #7
0
 def common_year(self):
     with when:
         result = is_leap(1993)
     with then:
         result == False
コード例 #8
0
def test_atypical_leap():
    assert is_leap(2000)
コード例 #9
0
 def test_common_year(self):
     self.assertFalse(is_leap(1993))
コード例 #10
0
 def test_atypical_leap(self):
     self.assertTrue(is_leap(2000))
コード例 #11
0
 def test_atypical_common(self):
     self.assertFalse(is_leap(1900))
コード例 #12
0
 def test_typical_leap(self):
     self.assertTrue(is_leap(1992))
コード例 #13
0
ファイル: main.py プロジェクト: absolutarin/onruby
from leap import is_leap

year = int(raw_input("Enter a year: "))
print is_leap(year)
コード例 #14
0
def test_typical_leap():
    assert is_leap(1992)
コード例 #15
0
def test_common_year():
    assert not is_leap(1993)
コード例 #16
0
def step_impl(context):
    assert is_leap(context.year)
コード例 #17
0
def step_impl(context):
    context.is_leap = str(is_leap(context.year))
コード例 #18
0
def test_atypical_common():
    assert not is_leap(1900)