def test_brand_has_no_dependents(brand_dep_mocks): brand = Brand() has = brand.has_dependents() assert has is False # Check calls on this test case because it should hit all of them. for m in ('bu', 'ish'): brand_dep_mocks[m].active_set.return_value \ .exists.assert_called_once_with()
def test_brand_stat_counts_issues(brand_dep_mocks): brand = Brand(issue_count=1) counts = brand.stat_counts() assert counts == {'issues': 1}
def test_brand_has_dependents_issue_count(brand_dep_mocks): brand = Brand(issue_count=1) has = brand.has_dependents() assert has is True
def test_brand_has_dependents_in_use(brand_dep_mocks): brand_dep_mocks['in_use'].exists.return_value = True brand = Brand() has = brand.has_dependents() assert has is False
def test_brand_has_dependents_revs_exist(brand_dep_mocks, which_exists): brand_dep_mocks[which_exists].active_set.return_value \ .exists.return_value = True brand = Brand() has = brand.has_dependents() assert has is True