Skip to content

Commit

Permalink
Update workspace commit test
Browse files Browse the repository at this point in the history
- empty commits in workspaces are not allowed
  • Loading branch information
jcelliott committed Jan 16, 2025
1 parent aef0f99 commit 9b2945b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions oxen/tests/test_workspace_commit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import pytest
from oxen import RemoteRepo, Workspace


Expand All @@ -18,5 +19,11 @@ def test_commit_one_file(
def test_commit_empty(celeba_remote_repo_one_image_pushed: RemoteRepo, shared_datadir):
_, remote_repo = celeba_remote_repo_one_image_pushed
workspace = Workspace(remote_repo, "main")
workspace.commit("a commit message")
assert len(remote_repo.log()) == 2

with pytest.raises(ValueError) as e:
# empty commits in workspace should raise an error
workspace.commit("a commit message")
assert "No changes to commit" in str(e)

# should still be 1 commit
assert len(remote_repo.log()) == 1

0 comments on commit 9b2945b

Please sign in to comment.