Skip to content

Commit

Permalink
content to save corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
ReimarBauer committed Aug 19, 2024
1 parent 218863e commit 6314b6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tests/_test_mscolab/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from mslib.mscolab.models import User, Operation, Permission, Change, Message
from mslib.mscolab.seed import add_user, get_user
from mslib.mscolab.utils import get_recent_op_id
from tests.utils import XML_CONTENT1, XML_CONTENT2
from tests.utils import XML_CONTENT1, XML_CONTENT2, XML_CONTENT3


class Test_Files:
Expand Down Expand Up @@ -127,15 +127,15 @@ def test_cant_save(self):

def test_undo(self):
with self.app.test_client():
flight_path, operation = self._create_operation(flight_path="operation7", content="alpha")
assert self.fm.save_file(operation.id, XML_CONTENT1, self.user)
flight_path, operation = self._create_operation(flight_path="operation7", content=XML_CONTENT1)
assert self.fm.save_file(operation.id, XML_CONTENT2, self.user)
assert self.fm.save_file(operation.id, XML_CONTENT3, self.user)
changes = Change.query.filter_by(op_id=operation.id).all()
assert changes is not None
assert changes[0].id == 1
assert self.fm.undo_changes(changes[0].id, self.user) is True
assert len(self.fm.get_all_changes(operation.id, self.user)) == 3
assert XML_CONTENT1 == self.fm.get_file(operation.id, self.user)
assert XML_CONTENT2 == self.fm.get_file(operation.id, self.user)

def test_get_operation(self):
with self.app.test_client():
Expand Down
4 changes: 2 additions & 2 deletions tests/_test_mscolab/test_files_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def test_get_all_changes(self):

def test_get_change_content(self):
with self.app.test_client():
flight_path, operation = self._create_operation(flight_path="V12", content='initial')
flight_path, operation = self._create_operation(flight_path="V12", content=XML_CONTENT3)
assert self.fm.save_file(operation.id, XML_CONTENT1, self.user)
assert self.fm.save_file(operation.id, XML_CONTENT2, self.user)
assert self.fm.save_file(operation.id, XML_CONTENT3, self.user)
Expand All @@ -194,7 +194,7 @@ def test_get_change_content(self):

def test_set_version_name(self):
with self.app.test_client():
flight_path, operation = self._create_operation(flight_path="V13", content='initial')
flight_path, operation = self._create_operation(flight_path="V13", content=XML_CONTENT3)
assert self.fm.save_file(operation.id, XML_CONTENT1, self.user)
all_changes = self.fm.get_all_changes(operation.id, self.user)
ch_id = all_changes[-1]["id"]
Expand Down

0 comments on commit 6314b6a

Please sign in to comment.