Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
939e226f
Commit
939e226f
authored
Nov 13, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepare infrastructure for Mercurial repository testing
Issue #511 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
7a181233
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
weblate/trans/tests/test_models.py
weblate/trans/tests/test_models.py
+28
-1
No files found.
weblate/trans/tests/test_models.py
View file @
939e226f
...
@@ -33,11 +33,12 @@ from weblate.trans.models import Project, SubProject, Unit, WhiteboardMessage
...
@@ -33,11 +33,12 @@ from weblate.trans.models import Project, SubProject, Unit, WhiteboardMessage
from
weblate.trans.models.source
import
Source
from
weblate.trans.models.source
import
Source
from
weblate
import
appsettings
from
weblate
import
appsettings
from
weblate.trans.tests.utils
import
get_test_file
from
weblate.trans.tests.utils
import
get_test_file
from
weblate.trans.vcs
import
GitRepository
from
weblate.trans.vcs
import
GitRepository
,
HgRepository
REPOWEB_URL
=
\
REPOWEB_URL
=
\
'https://github.com/nijel/weblate-test/blob/master/%(file)s#L%(line)s'
'https://github.com/nijel/weblate-test/blob/master/%(file)s#L%(line)s'
GIT_URL
=
'git://github.com/nijel/weblate-test.git'
GIT_URL
=
'git://github.com/nijel/weblate-test.git'
HG_URL
=
'https://nijel@bitbucket.org/nijel/weblate-test'
class
RepoTestCase
(
TestCase
):
class
RepoTestCase
(
TestCase
):
...
@@ -61,6 +62,17 @@ class RepoTestCase(TestCase):
...
@@ -61,6 +62,17 @@ class RepoTestCase(TestCase):
'test-repo.git'
'test-repo.git'
)
)
# Path where to clone remote repo for tests
self
.
hg_base_repo_path
=
os
.
path
.
join
(
settings
.
GIT_ROOT
,
'test-base-repo.hg'
)
# Repository on which tests will be performed
self
.
hg_repo_path
=
os
.
path
.
join
(
settings
.
GIT_ROOT
,
'test-repo.hg'
)
# Clone repo for testing
# Clone repo for testing
if
not
os
.
path
.
exists
(
self
.
git_base_repo_path
):
if
not
os
.
path
.
exists
(
self
.
git_base_repo_path
):
GitRepository
.
clone
(
GitRepository
.
clone
(
...
@@ -76,6 +88,21 @@ class RepoTestCase(TestCase):
...
@@ -76,6 +88,21 @@ class RepoTestCase(TestCase):
# Create repository copy for the test
# Create repository copy for the test
shutil
.
copytree
(
self
.
git_base_repo_path
,
self
.
git_repo_path
)
shutil
.
copytree
(
self
.
git_base_repo_path
,
self
.
git_repo_path
)
# Clone repo for testing
if
not
os
.
path
.
exists
(
self
.
hg_base_repo_path
):
HgRepository
.
clone
(
HG_URL
,
self
.
hg_base_repo_path
,
bare
=
True
)
# Remove possibly existing directory
if
os
.
path
.
exists
(
self
.
hg_repo_path
):
shutil
.
rmtree
(
self
.
hg_repo_path
)
# Create repository copy for the test
shutil
.
copytree
(
self
.
hg_base_repo_path
,
self
.
hg_repo_path
)
# Remove possibly existing project directory
# Remove possibly existing project directory
test_repo_path
=
os
.
path
.
join
(
settings
.
GIT_ROOT
,
'test'
)
test_repo_path
=
os
.
path
.
join
(
settings
.
GIT_ROOT
,
'test'
)
if
os
.
path
.
exists
(
test_repo_path
):
if
os
.
path
.
exists
(
test_repo_path
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment