Skip to content

Commit

Permalink
Get tests passing again
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Feb 5, 2020
1 parent 64ac50e commit 86df6cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os.path
import sys
from io import BytesIO, StringIO, TextIOWrapper
from itertools import zip_longest
from unittest.mock import patch

import pytest
Expand All @@ -21,7 +22,9 @@ def assert_equal(actual, expected, ordered=True):
if ordered:
assert actual == expected, '\n{}\n{}'.format(actual, expected)
else:
assert ocdskit.util.jsonlib.loads(actual) == ocdskit.util.jsonlib.loads(expected)
for a, b in zip_longest(actual.split('\n'), expected.split('\n'), fillvalue='{}'):
if a != b != '':
assert ocdskit.util.jsonlib.loads(a) == ocdskit.util.jsonlib.loads(b), '\n{}\n{}'.format(a, b)


@patch('sys.stdout', new_callable=StringIO)
Expand Down
2 changes: 1 addition & 1 deletion tests/commands/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_command_record_package(monkeypatch):
def test_command_record(monkeypatch):
assert_streaming(monkeypatch, main, ['upgrade', '1.0:1.1', '--root-path', 'records.item'],
['realdata/record-package_package.json'],
['realdata/record-package_package_1.1.json'])
['realdata/record-package_package_1.1.json'], ordered=False)


def test_command_release_package_buyer_procuring_entity_suppliers(monkeypatch):
Expand Down

0 comments on commit 86df6cc

Please sign in to comment.