def test_add_duplicate_town(self): t = Town('Test Town') s = State('Test State') s._add_town(t) with pytest.raises(ValueError) as verr: s._add_town(t) assert 'Town already exists' in str(verr.value)
def test_add_town(self): t = Town('Test Town') s = State('Test State') s._add_town(t) assert t in s.towns