Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
agkyra
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
itminedu
agkyra
Commits
deefcf34
Commit
deefcf34
authored
9 years ago
by
Giorgos Korfiatis
Browse files
Options
Downloads
Patches
Plain Diff
more tests...
parent
fa5d3d69
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test.py
+44
-0
44 additions, 0 deletions
test.py
with
44 additions
and
0 deletions
test.py
+
44
−
0
View file @
deefcf34
...
...
@@ -485,6 +485,50 @@ class AgkyraTest(unittest.TestCase):
with
self
.
assertRaises
(
common
.
BusyError
):
handle
.
hide_file
()
def
test_013_collisions
(
self
):
fil
=
"
f013
"
f_path
=
self
.
get_path
(
fil
)
with
open
(
f_path
,
"
w
"
)
as
f
:
f
.
write
(
"
content
"
)
self
.
s
.
probe_file
(
self
.
s
.
SLAVE
,
fil
)
self
.
assert_message
(
messaging
.
UpdateMessage
)
r
=
self
.
pithos
.
upload_from_string
(
fil
,
"
new
"
)
self
.
s
.
decide_file_sync
(
fil
)
self
.
assert_message
(
messaging
.
SyncMessage
)
self
.
assert_message
(
messaging
.
CollisionMessage
)
self
.
assert_message
(
messaging
.
SyncErrorMessage
)
d
=
"
d013
"
d_path
=
self
.
get_path
(
d
)
os
.
mkdir
(
d_path
)
self
.
s
.
probe_file
(
self
.
s
.
SLAVE
,
d
)
self
.
assert_message
(
messaging
.
UpdateMessage
)
r
=
self
.
pithos
.
upload_from_string
(
d
,
"
new
"
)
self
.
s
.
decide_file_sync
(
d
)
self
.
assert_message
(
messaging
.
SyncMessage
)
self
.
assert_message
(
messaging
.
CollisionMessage
)
self
.
assert_message
(
messaging
.
SyncErrorMessage
)
d_synced
=
"
d013_s
"
d_synced_path
=
self
.
get_path
(
d_synced
)
os
.
mkdir
(
d_synced_path
)
self
.
s
.
probe_file
(
self
.
s
.
SLAVE
,
d_synced
)
self
.
assert_message
(
messaging
.
UpdateMessage
)
self
.
s
.
decide_file_sync
(
d_synced
)
self
.
assert_message
(
messaging
.
SyncMessage
)
self
.
assert_message
(
messaging
.
AckSyncMessage
)
os
.
rmdir
(
d_synced_path
)
self
.
s
.
probe_file
(
self
.
s
.
SLAVE
,
d_synced
)
self
.
assert_message
(
messaging
.
UpdateMessage
)
r
=
self
.
pithos
.
upload_from_string
(
d_synced
,
"
new
"
)
self
.
s
.
decide_file_sync
(
d_synced
)
self
.
assert_message
(
messaging
.
SyncMessage
)
self
.
assert_message
(
messaging
.
CollisionMessage
)
self
.
assert_message
(
messaging
.
SyncErrorMessage
)
if
__name__
==
'
__main__
'
:
unittest
.
main
()
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