def test_is_empty(): """Ensure that is_empty reports emptiness as expected""" empty_aggregate_feed = AggregateFeed() non_empty_aggregate_feed = AggregateFeed() non_empty_aggregate_feed.add("foo") assert empty_aggregate_feed.is_empty() is True assert non_empty_aggregate_feed.is_empty() is False
def test_add(): """Add a xkcd_feed entry to the aggregate""" entry = Mock() subject = AggregateFeed() subject.add(entry) assert_equals(set([entry]), subject.entries)
def test_is_empty(): """Unsure is empty works""" aggregate_feed = AggregateFeed() assert aggregate_feed.is_empty() aggregate_feed.add("foo") assert not aggregate_feed.is_empty()