Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mischa Dombrowski
lbmweights
Commits
43293e43
Commit
43293e43
authored
Sep 03, 2019
by
MischaD
Browse files
Added codecoverage
parent
42e8c24b
Changes
2
Hide whitespace changes
Inline
Side-by-side
setup.cfg
0 → 100644
View file @
43293e43
[metadata]
description-file = README.md
[aliases]
test=pytest
[coverage:run]
omit=
tests/*
.tox/*
.eggs/*
[coverage:report]
include=lbmweights/*
ignore_errors=True
show_missing=True
\ No newline at end of file
test/__init__.py
View file @
43293e43
import
unittest
from
lbmweights.lattice
import
Lattice
class
TestAnalyzeTensorDimensions
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
lattice2
=
Lattice
(
dimension
=
2
,
order
=
2
,
shell_list
=
[
1
,
2
,
4
])
self
.
lattice4
=
Lattice
(
dimension
=
2
,
order
=
4
,
shell_list
=
[
1
,
2
,
4
])
self
.
lattice6
=
Lattice
(
dimension
=
2
,
order
=
6
,
shell_list
=
[
1
,
2
,
4
])
self
.
lattice8
=
Lattice
(
dimension
=
2
,
order
=
8
,
shell_list
=
[
1
,
2
,
4
])
def
test_analyze_tensor_dimensions
(
self
):
self
.
lattice2
.
calculate_weights
()
self
.
assertTrue
(
self
.
lattice2
.
_possible_tensors
==
[[[
2
]]])
self
.
lattice4
.
calculate_weights
()
self
.
assertTrue
(
self
.
lattice4
.
_possible_tensors
==
[[[
2
]],
[[
4
],
[
2
,
2
]]])
self
.
lattice6
.
calculate_weights
()
self
.
assertTrue
(
self
.
lattice6
.
_possible_tensors
==
[[[
2
]],
[[
4
],
[
2
,
2
]],
[[
6
],
[
4
,
2
],[
2
,
2
,
2
]]])
self
.
lattice8
.
calculate_weights
()
self
.
assertTrue
(
self
.
lattice8
.
_possible_tensors
==
[[[
2
]],
[[
4
],
[
2
,
2
]],
[[
6
],
[
4
,
2
],[
2
,
2
,
2
]],
[[
8
],[
6
,
2
],[
4
,
4
],[
4
,
2
,
2
],[
2
,
2
,
2
,
2
]]])
if
__name__
==
"__main__"
:
unittest
.
main
()
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