Пример #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
Пример #43
0
 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
Пример #45
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
Пример #47
0
 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