Skip to content

Commit af128a6

Browse files
committed
Test
1 parent 73ed82f commit af128a6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

readthedocs/rtd_tests/tests/test_backend.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,17 @@ def test_update_and_checkout(self):
265265
self.assertEqual(code, 0)
266266
self.assertTrue(exists(repo.working_dir))
267267

268+
def test_git_checkout_invalid_revision(self):
269+
repo = self.project.vcs_repo()
270+
repo.update()
271+
version = 'invalid-revision'
272+
with self.assertRaises(RepositoryError) as e:
273+
repo.checkout(version)
274+
self.assertEqual(
275+
str(e.exception),
276+
RepositoryError.FAILED_TO_CHECKOUT.format(version)
277+
)
278+
268279
def test_parse_tags(self):
269280
data = """\
270281
tip 13575:8e94a1b4e9a4

0 commit comments

Comments
 (0)