Skip to content

Commit

Permalink
Fix missing mocks for Parser
Browse files Browse the repository at this point in the history
The tests are not installing Snippy dependencies like the
Parser class because there are no release from Snippy that
contains these. There are temporary mocks that take care
of the Parser class. The mocks were missing for new groups
and tags attribute parsers.

Signed-off-by: Heikki Laaksonen <laaksonen.heikki.j@gmail.com>
  • Loading branch information
heilaaks committed Jun 21, 2019
1 parent e011c2f commit 1ef4921
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
def mock_snippy(mocker):
"""Mock Snippy."""

mocker.patch.object(Parser, "format_data", return_value=[])
mocker.patch.object(Parser, "format_data", return_value=())
mocker.patch.object(Parser, "format_brief", return_value="")
mocker.patch.object(Parser, "format_description", return_value="")
mocker.patch.object(Parser, "format_name", return_value="")
mocker.patch.object(Parser, "format_groups", return_value=())
mocker.patch.object(Parser, "format_tags", return_value=())


class Const(object): # pylint: disable=too-few-public-methods
Expand All @@ -56,3 +58,11 @@ def format_description(cls, category, value):
@classmethod
def format_name(cls, category, value):
"""Dummy method for mock."""

@classmethod
def format_groups(cls, category, value):
"""Dummy method for mock."""

@classmethod
def format_tags(cls, category, value):
"""Dummy method for mock."""

0 comments on commit 1ef4921

Please sign in to comment.