From 507272c4d6c6619ff6fa52b4c77d5074ad250795 Mon Sep 17 00:00:00 2001 From: Serj Date: Mon, 17 Apr 2023 22:23:46 +0300 Subject: [PATCH] Fix up test logic --- tests/test_wolverine.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_wolverine.py b/tests/test_wolverine.py index 0b44c69..1f82d76 100644 --- a/tests/test_wolverine.py +++ b/tests/test_wolverine.py @@ -1,7 +1,8 @@ import os +import json import pytest import tempfile -from wolverine import apply_changes +from wolverine import apply_changes, json_validated_response @pytest.fixture(scope='function') @@ -31,14 +32,14 @@ def test_apply_changes_replace(temp_file): def test_apply_changes_delete(temp_file): # Make a "delete" change to the third line changes = [ - {"operation": "Delete", "line": 3}, + {"operation": "Delete", "line": 3, "content": ""}, ] apply_changes(temp_file, changes) # Check that the file was updated correctly with open(temp_file) as f: content = f.read() - assert content == "first line\nsecond line" + assert content == "first line\nsecond line\n" def test_apply_changes_insert(temp_file): @@ -51,4 +52,5 @@ def test_apply_changes_insert(temp_file): # Check that the file was updated correctly with open(temp_file) as f: content = f.read() - assert content == "first line\nsecond line\ninserted line" + assert content == 'first line\nsecond line\ninserted line\nthird line' +