Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
beem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
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
hive
beem
Commits
0f83199d
Commit
0f83199d
authored
4 years ago
by
Holger
Browse files
Options
Downloads
Patches
Plain Diff
Fix unit test for make_patch
parent
6394fb44
No related branches found
No related tags found
2 merge requests
!5
Taken current version of master branch in the https://github.com/holgern/beem
,
!4
Original changes pushed to master at https://github.com/holgern/beem
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rst
+1
-1
1 addition, 1 deletion
CHANGELOG.rst
tests/beem/test_utils.py
+7
-7
7 additions, 7 deletions
tests/beem/test_utils.py
with
8 additions
and
8 deletions
CHANGELOG.rst
+
1
−
1
View file @
0f83199d
...
...
@@ -2,7 +2,7 @@ Changelog
=========
0.24.15
-------
* Add diff_match_patch dependency, as the difflib implementation do not work
* Add diff_match_patch dependency
again
, as the difflib implementation do
es
not work
0.24.14
-------
...
...
This diff is collapsed.
Click to expand it.
tests/beem/test_utils.py
+
7
−
7
View file @
0f83199d
...
...
@@ -74,10 +74,10 @@ class Testcases(unittest.TestCase):
self
.
assertEqual
(
len
(
derive_permlink
(
"
a
"
*
1024
)),
256
)
def
test_patch
(
self
):
self
.
assertEqual
(
make_patch
(
"
aa
"
,
"
ab
"
),
'
@@ -1 +1 @@
\n
-
a
a
\n
+
a
b
\n
'
)
self
.
assertEqual
(
make_patch
(
"
aa
\n
"
,
"
ab
\n
"
),
'
@@ -1 +1 @@
\n
-aa
\n
+ab
\n
'
)
self
.
assertEqual
(
make_patch
(
"
aa
"
,
"
ab
"
),
'
@@ -1
,2
+1
,2
@@
\n
a
\n
-a
\n
+b
\n
'
)
self
.
assertEqual
(
make_patch
(
"
aa
\n
"
,
"
ab
\n
"
),
'
@@ -1
,3
+1
,3
@@
\n
a
\n
-a
\n
+b
\n
%0A
\n
'
)
self
.
assertEqual
(
make_patch
(
"
Hello!
\n
Das ist ein Test!
\n
End.
\n
"
,
"
Hello!
\n
This is a Test
\n
End.
\n
"
),
'
@@ -
2 +2 @@
\n
-
Das ist ein
Test!
\n
+ This is a Test
\n
'
)
'
@@ -
5,25 +5,22 @@
\n
o!%0A
\n
-Da
\n
+Thi
\n
s is
\n
-
t ein
\n
+ a
\n
Test
\n
-!
\n
%0AEnd
\n
'
)
s1
=
"
test1
\n
test2
\n
test3
\n
test4
\n
test5
\n
test6
\n
"
s2
=
"
test1
\n
test2
\n
test3
\n
test4
\n
test5
\n
test6
\n
"
...
...
@@ -86,19 +86,19 @@ class Testcases(unittest.TestCase):
s2
=
"
test1
\n
test2
\n
test7
\n
test4
\n
test5
\n
test6
\n
"
patch
=
make_patch
(
s1
,
s2
)
self
.
assertEqual
(
patch
,
"
@@ -
3 +3
@@
\n
-
test3
\n
+tes
t7
\n
"
)
self
.
assertEqual
(
patch
,
"
@@ -
13,9 +13,9
@@
\n
test
\n
-
3
\n
+
7
\n
%0A
tes
\n
"
)
s2
=
"
test1
\n
test2
\n
test3
\n
test4
\n
test5
\n
"
patch
=
make_patch
(
s1
,
s2
)
self
.
assertEqual
(
patch
,
"
@@ -
6 +5,0 @@
\n
-test6
\n
"
)
self
.
assertEqual
(
patch
,
"
@@ -
27,10 +27,4 @@
\n
st5%0A
\n
-test6
%0A
\n
"
)
s2
=
"
test2
\n
test3
\n
test4
\n
test5
\n
test6
\n
"
patch
=
make_patch
(
s1
,
s2
)
self
.
assertEqual
(
patch
,
'
@@ -1
+0,0
@@
\n
-test1
\n
'
)
self
.
assertEqual
(
patch
,
'
@@ -1
,10 +1,4
@@
\n
-test1
%0A
\n
test
\n
'
)
s2
=
""
patch
=
make_patch
(
s1
,
s2
)
self
.
assertEqual
(
patch
,
'
@@ -1,6 +0,0 @@
\n
-test1
\n
-
test2
\n
-
test3
\n
-
test4
\n
-
test5
\n
-
test6
\n
'
)
self
.
assertEqual
(
patch
,
'
@@ -1,
3
6 +0,0 @@
\n
-test1
%0A
test2
%0A
test3
%0A
test4
%0A
test5
%0A
test6
%0A
\n
'
)
def
test_formatTimedelta
(
self
):
now
=
datetime
.
now
()
...
...
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