コード例 #1
0
def test_list(capsys, session):
    repos = ["a/a", "bcd/def", "foo-bar/spam-and-eggs", "foo-bar/zoo"]
    for i in range(len(repos)):
        add(repos[-i])
    list_()
    out, _ = capsys.readouterr()
    assert_that(out, string_contains_in_order(*repos))
コード例 #2
0
def test_list(capsys, session):
    repos = ["a/a", "bcd/def", "foo-bar/spam-and-eggs", "foo-bar/zoo"]
    for i in range(len(repos)):
        add(repos[-i])
    list_()
    out, _ = capsys.readouterr()
    assert_that(out, string_contains_in_order(*repos))
コード例 #3
0
def test_add_existing(session):
    add("invenio/kwalitee")
    add("invenio/kwalitee")
    assert_that(Account.query.filter_by(name="invenio").count(),
                equal_to(1))
    assert_that(Repository.query.filter_by(name="kwalitee").count(),
                equal_to(1))
コード例 #4
0
def test_add(capsys, session):
    add("invenio/kwalitee")
    _, err = capsys.readouterr()
    assert_that(err, contains_string("invenio/kwalitee"))
    assert_that(Account.query.filter_by(name="invenio").count(), equal_to(1))
    assert_that(
        Repository.query.filter_by(name="kwalitee").count(), equal_to(1))
コード例 #5
0
def test_add(capsys, session):
    add("invenio/kwalitee")
    _, err = capsys.readouterr()
    assert_that(err, contains_string("invenio/kwalitee"))
    assert_that(Account.query.filter_by(name="invenio").count(),
                equal_to(1))
    assert_that(Repository.query.filter_by(name="kwalitee").count(),
                equal_to(1))
コード例 #6
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))
コード例 #7
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))
コード例 #8
0
def test_add_invalid_name(capsys, session):
    assert_that(add("foo"), equal_to(1))
    _, err = capsys.readouterr()
    assert_that(err, contains_string("foo is not a valid repository"))
コード例 #9
0
def test_add_invalid_name(capsys, session):
    assert_that(add("foo"), equal_to(1))
    _, err = capsys.readouterr()
    assert_that(err, contains_string("foo is not a valid repository"))
コード例 #10
0
def test_add_existing(session):
    add("invenio/kwalitee")
    add("invenio/kwalitee")
    assert_that(Account.query.filter_by(name="invenio").count(), equal_to(1))
    assert_that(
        Repository.query.filter_by(name="kwalitee").count(), equal_to(1))