Skip to content

Commit

Permalink
Remove unused tests and references to models
Browse files Browse the repository at this point in the history
  • Loading branch information
nickstenning committed Jan 7, 2016
1 parent 51cb870 commit 5d24e19
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
27 changes: 1 addition & 26 deletions h/api/search/test/transform_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def test_prepare_adds_scope_field(_, ann_in, ann_out, uri_normalize):
assert ann_in == ann_out


@mock.patch('h.api.search.transform.models')
@mock.patch('h.api.search.transform.groups')
@pytest.mark.usefixtures("uri_normalize")
@pytest.mark.parametrize("ann_in,ann_out", [
Expand Down Expand Up @@ -99,35 +98,11 @@ def test_prepare_adds_scope_field(_, ann_in, ann_out, uri_normalize):
({"references": [], "target": []},
{"references": [], "target": []}),
])
def test_prepare_transforms_old_style_comments(models, groups, ann_in, ann_out):
def test_prepare_transforms_old_style_comments(groups, ann_in, ann_out):
transform.prepare(ann_in)
assert ann_in == ann_out


@mock.patch('h.api.search.transform.models')
@mock.patch('h.api.search.transform.groups')
def test_prepare_does_nothing_if_parents_target_is_not_a_list(_, models):
"""It should do nothing to replies if the parent's target isn't a list.
If the annotation is a reply and its parent's 'target' is not a list then
it should not modify the reply's 'target' at all.
"""
parent_annotation = {
'id': 'parent_annotation_id',
'target': 'not a list'
}
reply = {
'references': [parent_annotation['id'], 'some other id'],
'target': mock.sentinel.target
}
models.Annotation.fetch.return_value = parent_annotation

transform.prepare(reply)

assert reply['target'] == mock.sentinel.target


@mock.patch('h.api.search.transform.groups')
@pytest.mark.parametrize("ann,nipsa", [
({"user": "george"}, True),
Expand Down
1 change: 0 additions & 1 deletion h/api/search/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from h.api import nipsa
from h.api import uri
from h.api import groups
from h.api import models


def prepare(annotation):
Expand Down

0 comments on commit 5d24e19

Please sign in to comment.