Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
skais
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Raphael Sturgis
skais
Merge requests
!9
Resolve "Creation of images from AIS"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Creation of images from AIS"
16-creation-of-images-from-ais
into
develop
Overview
0
Commits
6
Pipelines
0
Changes
2
Merged
Raphael Sturgis
requested to merge
16-creation-of-images-from-ais
into
develop
3 years ago
Overview
0
Commits
6
Pipelines
0
Changes
2
Expand
Closes
#16 (closed)
0
0
Merge request reports
Viewing commit
9c4e8021
Prev
Next
Show latest version
2 files
+
65
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
9c4e8021
implementation of bresenham
· 9c4e8021
Raphael
authored
3 years ago
skais/tests/utils/test_geometry.py
0 → 100644
+
35
−
0
Options
import
unittest
from
skais.utils.geometry
import
bresenham
class
TestGeometry
(
unittest
.
TestCase
):
def
test_bresenham
(
self
):
result
=
bresenham
(
3
,
4
,
16
,
9
)
expected
=
[(
3
,
4
),
(
4
,
4
),
(
5
,
5
),
(
6
,
5
),
(
7
,
6
),
(
8
,
6
),
(
9
,
6
),
(
10
,
7
),
(
11
,
7
),
(
12
,
7
),
(
13
,
8
),
(
14
,
8
),
(
15
,
9
),
(
16
,
9
)]
self
.
assertListEqual
(
result
,
expected
)
def
test_bresenham_inverted
(
self
):
result
=
bresenham
(
16
,
9
,
3
,
4
)
expected
=
[(
3
,
4
),
(
4
,
4
),
(
5
,
5
),
(
6
,
5
),
(
7
,
6
),
(
8
,
6
),
(
9
,
6
),
(
10
,
7
),
(
11
,
7
),
(
12
,
7
),
(
13
,
8
),
(
14
,
8
),
(
15
,
9
),
(
16
,
9
)]
self
.
assertListEqual
(
result
,
expected
)
def
test_bresenham_same_line
(
self
):
result
=
bresenham
(
3
,
4
,
10
,
4
)
expected
=
[(
3
,
4
),
(
4
,
4
),
(
5
,
4
),
(
6
,
4
),
(
7
,
4
),
(
8
,
4
),
(
9
,
4
),
(
10
,
4
)]
self
.
assertListEqual
(
result
,
expected
)
def
test_bresenham_same_column
(
self
):
result
=
bresenham
(
3
,
4
,
3
,
10
)
expected
=
[(
3
,
4
),
(
3
,
5
),
(
3
,
6
),
(
3
,
7
),
(
3
,
8
),
(
3
,
9
),
(
3
,
10
)]
self
.
assertListEqual
(
result
,
expected
)
if
__name__
==
'
__main__
'
:
unittest
.
main
()
Loading