Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-loader-mercurial
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine R. Dumont
swh-loader-mercurial
Commits
eb613d75
Commit
eb613d75
authored
4 years ago
by
David Douard
Browse files
Options
Downloads
Patches
Plain Diff
Fix branches types in tests
branch names and targets are expected to be bytes.
parent
385dacfa
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
requirements-swh.txt
+1
-1
1 addition, 1 deletion
requirements-swh.txt
swh/loader/mercurial/tests/test_loader.py
+21
-14
21 additions, 14 deletions
swh/loader/mercurial/tests/test_loader.py
with
22 additions
and
15 deletions
requirements-swh.txt
+
1
−
1
View file @
eb613d75
swh.model >= 0.4.0
swh.storage >= 0.10.0
swh.scheduler >= 0.0.39
swh.loader.core >= 0.5.
2
swh.loader.core >= 0.5.
5
This diff is collapsed.
Click to expand it.
swh/loader/mercurial/tests/test_loader.py
+
21
−
14
View file @
eb613d75
...
...
@@ -11,7 +11,7 @@ import time
import
hglib
import
pytest
from
swh.model
import
hash
util
from
swh.model
.hashutil
import
hash
_to_bytes
from
swh.model.model
import
RevisionType
from
swh.storage.algos.snapshot
import
snapshot_get_latest
from
swh.loader.tests
import
(
...
...
@@ -39,7 +39,7 @@ def test_loader_hg_new_visit_no_release(swh_config, datadir, tmp_path):
repo_url
,
status
=
"
full
"
,
type
=
"
hg
"
,
snapshot
=
hashutil
.
hash_to_bytes
(
"
3b8fe58e467deb7597b12a5fd3b2c096b8c02028
"
),
snapshot
=
hash_to_bytes
(
"
3b8fe58e467deb7597b12a5fd3b2c096b8c02028
"
),
)
stats
=
get_stats
(
loader
.
storage
)
...
...
@@ -60,9 +60,15 @@ def test_loader_hg_new_visit_no_release(swh_config, datadir, tmp_path):
expected_snapshot
=
{
"
id
"
:
"
3b8fe58e467deb7597b12a5fd3b2c096b8c02028
"
,
"
branches
"
:
{
"
develop
"
:
{
"
target
"
:
tip_revision_develop
,
"
target_type
"
:
"
revision
"
},
"
default
"
:
{
"
target
"
:
tip_revision_default
,
"
target_type
"
:
"
revision
"
},
"
HEAD
"
:
{
"
target
"
:
"
develop
"
,
"
target_type
"
:
"
alias
"
,},
b
"
develop
"
:
{
"
target
"
:
hash_to_bytes
(
tip_revision_develop
),
"
target_type
"
:
"
revision
"
,
},
b
"
default
"
:
{
"
target
"
:
hash_to_bytes
(
tip_revision_default
),
"
target_type
"
:
"
revision
"
,
},
b
"
HEAD
"
:
{
"
target
"
:
b
"
develop
"
,
"
target_type
"
:
"
alias
"
,},
},
}
...
...
@@ -90,7 +96,7 @@ def test_loader_hg_new_visit_no_release(swh_config, datadir, tmp_path):
archive_path
,
status
=
"
full
"
,
type
=
"
hg
"
,
snapshot
=
hashutil
.
hash_to_bytes
(
"
3b8fe58e467deb7597b12a5fd3b2c096b8c02028
"
),
snapshot
=
hash_to_bytes
(
"
3b8fe58e467deb7597b12a5fd3b2c096b8c02028
"
),
)
...
...
@@ -121,22 +127,23 @@ def test_loader_hg_new_visit_with_release(swh_config, datadir, tmp_path):
# cf. test_loader.org for explaining from where those hashes
tip_release
=
"
515c4d72e089404356d0f4b39d60f948b8999140
"
release
=
loader
.
storage
.
release_get
([
hashutil
.
hash_to_bytes
(
tip_release
)])
release
=
loader
.
storage
.
release_get
([
hash_to_bytes
(
tip_release
)])
assert
release
is
not
None
tip_revision_default
=
"
c3dbe4fbeaaa98dd961834e4007edb3efb0e2a27
"
revision
=
loader
.
storage
.
revision_get
(
[
hashutil
.
hash_to_bytes
(
tip_revision_default
)]
)
revision
=
loader
.
storage
.
revision_get
([
hash_to_bytes
(
tip_revision_default
)])
assert
revision
is
not
None
expected_snapshot_id
=
"
d35668e02e2ba4321dc951cd308cf883786f918a
"
expected_snapshot
=
{
"
id
"
:
expected_snapshot_id
,
"
branches
"
:
{
"
default
"
:
{
"
target
"
:
tip_revision_default
,
"
target_type
"
:
"
revision
"
},
"
0.1
"
:
{
"
target
"
:
tip_release
,
"
target_type
"
:
"
release
"
},
"
HEAD
"
:
{
"
target
"
:
"
default
"
,
"
target_type
"
:
"
alias
"
,},
b
"
default
"
:
{
"
target
"
:
hash_to_bytes
(
tip_revision_default
),
"
target_type
"
:
"
revision
"
,
},
b
"
0.1
"
:
{
"
target
"
:
hash_to_bytes
(
tip_release
),
"
target_type
"
:
"
release
"
,},
b
"
HEAD
"
:
{
"
target
"
:
b
"
default
"
,
"
target_type
"
:
"
alias
"
,},
},
}
...
...
@@ -167,7 +174,7 @@ def test_loader_hg_new_visit_with_release(swh_config, datadir, tmp_path):
archive_path
,
status
=
"
full
"
,
type
=
"
hg
"
,
snapshot
=
hashutil
.
hash_to_bytes
(
expected_snapshot_id
),
snapshot
=
hash_to_bytes
(
expected_snapshot_id
),
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment