def test_ipub_has_dependents_issue_count(ipub_dep_mock): ipub = IndiciaPublisher(issue_count=1) has = ipub.has_dependents() assert has is True
def test_ipub_stat_counts(): with mock.patch('%s.IndiciaPublisher.active_issues' % PATH) as is_mock: is_mock.return_value.exists.return_value = False counts = IndiciaPublisher().stat_counts() assert counts == {'indicia publishers': 1}
def test_ipub_has_dependents_revs_exist(ipub_dep_mock): ipub_dep_mock.active_set.return_value.exists.return_value = True ipub = IndiciaPublisher() has = ipub.has_dependents() assert has is True
def test_ipub_has_no_dependents(ipub_dep_mock): ipub = IndiciaPublisher() has = ipub.has_dependents() assert has is False ipub_dep_mock.active_set.return_value.exists.assert_called_once_with()