Skip to content

Commit

Permalink
misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
emanueldima committed Apr 29, 2017
1 parent 719a92e commit 6aa093b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
[pytest]
#addopts = --pep8 --ignore=docs --cov=b2share --cov-report=term-missing
addopts = --ignore=tests/old_b2share --ignore=docs --cov=b2share --cov=demo --cov-report=term-missing
#addopts = --ignore=tests/old_b2share --ignore=docs --cov=b2share
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def test_create_community2(app, test_communities):
["create"],
obj=script_info)
assert result.exit_code != 0


def test_edit_community(app, test_communities):
with app.app_context():
Expand Down Expand Up @@ -99,5 +98,4 @@ def test_edit_community2(app, test_communities):
"NEW_NAME2"],
obj=script_info)
assert result.exit_code != 0


13 changes: 5 additions & 8 deletions tests/b2share_functional_tests/cli_tests/test_schema_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
from click.testing import CliRunner
from flask_cli import ScriptInfo
from flask import url_for

from invenio_db import db
from invenio_files_rest.models import Location
import traceback

from b2share.modules.communities.api import Community
from b2share.modules.communities.cli import communities as communities_cmd
Expand Down Expand Up @@ -59,10 +59,6 @@
"required": ["test_field1"]
}

configurations = [({'config': {'PREFERRED_URL_SCHEME': 'https'}}),
({'config': {'PREFERRED_URL_SCHEME': 'http'}})]

@pytest.mark.parametrize('app', configurations, indirect=['app'])
def test_existing_community_set_schema_cmd(app, test_communities):
"""Test the `schemas set_schema` CLI command."""
with app.app_context():
Expand All @@ -88,7 +84,6 @@ def test_existing_community_set_schema_cmd(app, test_communities):
assert result.exit_code == 0


@pytest.mark.parametrize('app', configurations, indirect=['app'])
def test_new_community_set_schema_cmd(app, login_user, tmp_location):
"""Test adding a community and setting its schema using CLI commands."""
with app.app_context():
Expand Down Expand Up @@ -198,7 +193,7 @@ def test_block_schema_list(app):
assert result.exit_code == 0
test_string = result.output[len(result.output)-10:len(result.output)-1]
assert test_string == '#VERSIONS' #no block schemas present empty header

def test_create_block_schema(app, test_communities):
"""Test creation of a block schema"""
#happy flow
Expand All @@ -208,11 +203,13 @@ def test_create_block_schema(app, test_communities):
result = runner.invoke(schemas_cmd, [
'block_schema_add',
'cccccccc-1111-1111-1111-111111111111',
'Block Schema Name'],
'Block Schema Name'],
obj=script_info)
assert result.exit_code == 0
result = runner.invoke(schemas_cmd, [
'block_schema_list'
],
obj=script_info)
# search only for "Block Schema Na", as the rest of the string is cut
# by the pretty printer (multiple columns)
assert(result.output.find("Block Schema Na") > 0)

0 comments on commit 6aa093b

Please sign in to comment.