Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 4
0
def test_cat_to_hooman(hooman_age, cat_age):
    assert catmath.cat_years_to_hooman_years(hooman_age) == cat_age
Esempio n. 5
0
def test__is_cat_leap_year__succeeds():
    assert catmath.cat_years_to_hooman_years(0) == 0
Esempio n. 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
Esempio n. 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
Esempio n. 8
0
def test__cat_years_to_hooman_years__NaN__fails():
    with pytest.raises(TypeError):
        catmath.cat_years_to_hooman_years(None)
Esempio n. 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)
Esempio n. 10
0
def test__cat_years_to_hooman_years__middle_age__succeeds(age, expected):
    assert catmath.cat_years_to_hooman_years(age) == expected
Esempio n. 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
Esempio n. 12
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    age = 50
    assert catmath.cat_years_to_hooman_years(age) == CY * age
Esempio n. 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
Esempio n. 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
Esempio n. 15
0
def test__cat_years_to_hooman_years__partial_year__succeeds():
    assert catmath.cat_years_to_hooman_years(2.5) == 12.5
Esempio n. 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
Esempio n. 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)
Esempio n. 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
Esempio n. 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
Esempio n. 20
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    assert catmath.cat_years_to_hooman_years(10) == 50
Esempio n. 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
Esempio n. 22
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    age = 50
    assert catmath.cat_years_to_hooman_years(age) == CY * age
Esempio n. 23
0
def test__cat_years_to_hooman_years__negative_year__succeeds():
    assert catmath.cat_years_to_hooman_years(-1) == -5
Esempio n. 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
Esempio n. 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
Esempio n. 26
0
def test__cat_years_to_hooman_years__middle_age__succeeds():
    assert cat_years_to_hooman_years(3) == 15
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 34
0
def test__cat_years_to_hooman(age, expected):
    assert catmath.cat_years_to_hooman_years(age) == expected
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 40
0
def test__cat_years_to_hooman_years__0__returns_0():
    assert catmath.cat_years_to_hooman_years(0) == 0
Esempio n. 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
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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
Esempio n. 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