def test_remove(session): add("invenio/kwalitee") remove("invenio/kwalitee") remove("invenio/kwalitee") remove("kwalitee/kwalitee") assert_that(Account.query.filter_by(name="invenio").count(), equal_to(1)) assert_that( Repository.query.filter_by(name="kwalitee").count(), equal_to(0))
def test_remove(session): add("invenio/kwalitee") remove("invenio/kwalitee") remove("invenio/kwalitee") remove("kwalitee/kwalitee") assert_that(Account.query.filter_by(name="invenio").count(), equal_to(1)) assert_that(Repository.query.filter_by(name="kwalitee").count(), equal_to(0))
def test_remove_invalid_name(capsys, session): assert_that(remove("foo"), equal_to(1)) _, err = capsys.readouterr() assert_that(err, contains_string("foo is not a valid repository"))