Skip to content

Commit a45f45f

Browse files
committed
More test
1 parent ee26443 commit a45f45f

File tree

1 file changed

+1
-51
lines changed

1 file changed

+1
-51
lines changed

tests/test_git.py

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44

55
import datetime
66
import os
7-
import re
87
import textwrap
98

109
import pytest
1110

1211
from libvcs import exc
1312
from libvcs._compat import string_types
14-
from libvcs.git import GitRemote, GitRepo
13+
from libvcs.git import GitRemote, GitRepo, extract_status
1514
from libvcs.shortcuts import create_repo_from_pip_url
1615
from libvcs.util import run, which
1716

@@ -205,55 +204,6 @@ def test_set_remote(git_repo, repo_name, new_repo_url):
205204
), 'Running remove_set should overwrite previous remote'
206205

207206

208-
def extract_status(value):
209-
"""Returns `git status -sb --porcelain=2` extracted to a dict"""
210-
pattern = re.compile(
211-
r"""[\n\r]?
212-
(
213-
#
214-
\W+
215-
branch.oid\W+
216-
(?P<branch_oid>
217-
[a-f0-9]{40}
218-
)
219-
)?
220-
(
221-
#
222-
\W+
223-
branch.head
224-
[\W]+
225-
(?P<branch_head>
226-
[\w-]*
227-
)
228-
229-
)?
230-
(
231-
#
232-
\W+
233-
branch.upstream
234-
[\W]+
235-
(?P<branch_upstream>
236-
[/\w-]*
237-
)
238-
)?
239-
(
240-
#
241-
\W+
242-
branch.ab
243-
[\W]+
244-
(?P<branch_ab>
245-
\+(?P<branch_ahead>\d+)
246-
\W{1}
247-
\-(?P<branch_behind>\d+)
248-
)
249-
)?
250-
""",
251-
re.VERBOSE | re.MULTILINE,
252-
)
253-
matches = pattern.search(value)
254-
return matches.groupdict()
255-
256-
257207
def test_extract_status():
258208
FIXTURE_A = textwrap.dedent(
259209
"""

0 commit comments

Comments
 (0)