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