示例#1
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    loop_results = []
    for x in [element * 0.1 for element in range(0, 10)]:
        loop_results.append(catmath.cat_years_to_hooman_years(x) < 5)

    if sum(loop_results) == len(loop_results):
        assert True
    else:
        assert False
示例#2
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    loop_results = []
    for x in range(6, 100, 1):
        loop_results.append(catmath.cat_years_to_hooman_years(x) >= 30)

    if sum(loop_results) == len(loop_results):
        assert True
    else:
        assert False
示例#3
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    cat_age = 0.1
    hooman_age = catmath.cat_years_to_hooman_years(cat_age)
    assert hooman_age == 0.5
示例#4
0
def test_cat_to_hooman(hooman_age, cat_age):
    assert catmath.cat_years_to_hooman_years(hooman_age) == cat_age
示例#5
0
def test__is_cat_leap_year__succeeds():
    assert catmath.cat_years_to_hooman_years(0) == 0
示例#6
0
def test__cat_years_to_hooman_years__0__returns_0():
    hooman_age = catmath.cat_years_to_hooman_years(0)
    assert hooman_age == 0
示例#7
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    age = 0.5
    assert catmath.cat_years_to_hooman_years(age) == CY * age
示例#8
0
def test__cat_years_to_hooman_years__NaN__fails():
    with pytest.raises(TypeError):
        catmath.cat_years_to_hooman_years(None)
示例#9
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    hooman_age = catmath.cat_years_to_hooman_years(8)
    assert hooman_age == (8 * 5)
示例#10
0
def test__cat_years_to_hooman_years__middle_age__succeeds(age, expected):
    assert catmath.cat_years_to_hooman_years(age) == expected
示例#11
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    age = 0.5
    assert catmath.cat_years_to_hooman_years(age) == CY * age
示例#12
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    age = 50
    assert catmath.cat_years_to_hooman_years(age) == CY * age
示例#13
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    cat_age = random.randint(1, 20)
    human_age = catmath.cat_years_to_hooman_years(cat_age)
    assert human_age == cat_age*catmath.NUM_HOOMAN_YEARS_IN_CAT_YEAR
示例#14
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    cat_age = random.randint(1, 9)/10
    human_age = catmath.cat_years_to_hooman_years(cat_age)
    assert human_age == cat_age*catmath.NUM_HOOMAN_YEARS_IN_CAT_YEAR
示例#15
0
def test__cat_years_to_hooman_years__partial_year__succeeds():
    assert catmath.cat_years_to_hooman_years(2.5) == 12.5
示例#16
0
def test__cat_years_to_hooman_years__0__returns_0():
    hooman_age = catmath.cat_years_to_hooman_years(0)
    assert hooman_age == 0
示例#17
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    hooman_age = catmath.cat_years_to_hooman_years(0.3)
    assert hooman_age == (0.3 * 5)
示例#18
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    cat_age = 0.1
    hooman_age = catmath.cat_years_to_hooman_years(cat_age)
    assert hooman_age == 0.5
示例#19
0
def test__cat_years_to_hooman_years__0__returns_0():
    if catmath.cat_years_to_hooman_years(0) == 0:
        assert True
    else:
        assert False
示例#20
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    assert catmath.cat_years_to_hooman_years(10) == 50
示例#21
0
def test__cat_years_to_hooman_years__0__returns_0():
    cat_age = 0
    age = catmath.cat_years_to_hooman_years(cat_age)
    assert age == 0
示例#22
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    age = 50
    assert catmath.cat_years_to_hooman_years(age) == CY * age
示例#23
0
def test__cat_years_to_hooman_years__negative_year__succeeds():
    assert catmath.cat_years_to_hooman_years(-1) == -5
示例#24
0
def test__cat_years_to_hooman_years__middle_age__succeeds(age_cat, age_human):
    human_years = catmath.cat_years_to_hooman_years(age_cat)
    assert human_years == age_human
示例#25
0
def test__cat_years_to_hooman_years__0__returns_0():
    cat_age = 0
    assert catmath.cat_years_to_hooman_years(cat_age) == 0
示例#26
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    assert cat_years_to_hooman_years(3) == 15
示例#27
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    cat_age = 5
    assert catmath.cat_years_to_hooman_years(cat_age) == 25
示例#28
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    hooman_years = catmath.cat_years_to_hooman_years(5)
    assert hooman_years == 25
示例#29
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    cat_age = .5
    assert catmath.cat_years_to_hooman_years(cat_age) == 2.5
示例#30
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    cat_age = 7
    hooman_age = catmath.cat_years_to_hooman_years(cat_age)
    assert hooman_age == 35
示例#31
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    hooman_years = catmath.cat_years_to_hooman_years(5)
    assert hooman_years == 25
示例#32
0
def test__cat_years_to_hooman_years__0__returns_0():
    assert catmath.cat_years_to_hooman_years(0) == 0
    assert catmath.cat_years_to_hooman_years(0.0) == 0.0
示例#33
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    hooman_years = catmath.cat_years_to_hooman_years(0.5)
    assert hooman_years == 2.5
示例#34
0
def test__cat_years_to_hooman(age, expected):
    assert catmath.cat_years_to_hooman_years(age) == expected
示例#35
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    cat_age = 8
    hooman_age = catmath.cat_years_to_hooman_years(cat_age)
    assert hooman_age == cat_age * catmath.NUM_HOOMAN_YEARS_IN_CAT_YEAR
示例#36
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    cat_age = 7
    hooman_age = catmath.cat_years_to_hooman_years(cat_age)
    assert hooman_age == 35
示例#37
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    cat_age = 0.1
    hooman_age = catmath.cat_years_to_hooman_years(cat_age)
    assert hooman_age == cat_age * catmath.NUM_HOOMAN_YEARS_IN_CAT_YEAR
示例#38
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds(
    age, expected
):
    assert catmath.cat_years_to_hooman_years(age) == expected
示例#39
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    cat_age = random.randint(1, 9) / 10
    human_age = catmath.cat_years_to_hooman_years(cat_age)
    assert human_age == cat_age * catmath.NUM_HOOMAN_YEARS_IN_CAT_YEAR
示例#40
0
def test__cat_years_to_hooman_years__0__returns_0():
    assert catmath.cat_years_to_hooman_years(0) == 0
示例#41
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    cat_age = random.randint(1, 20)
    human_age = catmath.cat_years_to_hooman_years(cat_age)
    assert human_age == cat_age * catmath.NUM_HOOMAN_YEARS_IN_CAT_YEAR
示例#42
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    assert catmath.cat_years_to_hooman_years(.5) == 2.5
 def test__cat_years_to_hooman_years__0__returns_0(self):
     self.assertEqual(catmath.cat_years_to_hooman_years(0), 0)
示例#44
0
def test__cat_years_to_hooman_years__0__returns_0():
    age = 0
    assert catmath.cat_years_to_hooman_years(age) == 0
 def test__cat_years_to_hooman_years__middle_age__succeeds(self):
     self.assertEqual(catmath.cat_years_to_hooman_years(8), 40)
示例#46
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    if catmath.cat_years_to_hooman_years(0.1) < 1:
        assert True
    else:
        assert False
 def test__cat_years_to_hooman_years__less_than_one_year__succeeds(self):
     self.assertEqual(catmath.cat_years_to_hooman_years(.5), 2.5)
示例#48
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    if catmath.cat_years_to_hooman_years(7) == 35:
        assert True
    else:
        assert False
示例#49
0
def test__cat_years_to_hooman_years__less_than_one_year__succeeds():
    cat_years = 0.5
    human_years = catmath.cat_years_to_hooman_years(cat_years)
    assert human_years == 2.5