Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
lscsoft
bilby
Commits
b8a17695
Commit
b8a17695
authored
5 years ago
by
Moritz
Browse files
Options
Downloads
Patches
Plain Diff
Added some tests for caching
parent
bd1dfb91
No related branches found
No related tags found
1 merge request
!466
Fixes a bug with the cache when calling frequency_domain_strain and time domain strain after each other
Pipeline
#60193
passed
5 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/waveform_generator_test.py
+51
-0
51 additions, 0 deletions
test/waveform_generator_test.py
with
51 additions
and
0 deletions
test/waveform_generator_test.py
+
51
−
0
View file @
b8a17695
...
...
@@ -276,6 +276,32 @@ class TestFrequencyDomainStrainMethod(unittest.TestCase):
new_waveform
=
self
.
waveform_generator
.
frequency_domain_strain
()
self
.
assertDictEqual
(
original_waveform
,
new_waveform
)
def
test_frequency_domain_caching_and_using_time_domain_strain_without_parameters
(
self
):
original_waveform
=
self
.
waveform_generator
.
frequency_domain_strain
(
parameters
=
self
.
simulation_parameters
)
new_waveform
=
self
.
waveform_generator
.
time_domain_strain
()
self
.
assertNotEqual
(
original_waveform
,
new_waveform
)
def
test_frequency_domain_caching_and_using_time_domain_strain_with_parameters
(
self
):
original_waveform
=
self
.
waveform_generator
.
frequency_domain_strain
(
parameters
=
self
.
simulation_parameters
)
new_waveform
=
self
.
waveform_generator
.
time_domain_strain
(
parameters
=
self
.
simulation_parameters
)
self
.
assertNotEqual
(
original_waveform
,
new_waveform
)
def
test_time_domain_caching_and_using_frequency_domain_strain_without_parameters
(
self
):
original_waveform
=
self
.
waveform_generator
.
time_domain_strain
(
parameters
=
self
.
simulation_parameters
)
new_waveform
=
self
.
waveform_generator
.
frequency_domain_strain
()
self
.
assertNotEqual
(
original_waveform
,
new_waveform
)
def
test_time_domain_caching_and_using_frequency_domain_strain_with_parameters
(
self
):
original_waveform
=
self
.
waveform_generator
.
time_domain_strain
(
parameters
=
self
.
simulation_parameters
)
new_waveform
=
self
.
waveform_generator
.
frequency_domain_strain
(
parameters
=
self
.
simulation_parameters
)
self
.
assertNotEqual
(
original_waveform
,
new_waveform
)
class
TestTimeDomainStrainMethod
(
unittest
.
TestCase
):
...
...
@@ -380,6 +406,31 @@ class TestTimeDomainStrainMethod(unittest.TestCase):
new_waveform
=
self
.
waveform_generator
.
time_domain_strain
()
self
.
assertDictEqual
(
original_waveform
,
new_waveform
)
def
test_frequency_domain_caching_and_using_time_domain_strain_without_parameters
(
self
):
original_waveform
=
self
.
waveform_generator
.
frequency_domain_strain
(
parameters
=
self
.
simulation_parameters
)
new_waveform
=
self
.
waveform_generator
.
time_domain_strain
()
self
.
assertNotEqual
(
original_waveform
,
new_waveform
)
def
test_frequency_domain_caching_and_using_time_domain_strain_with_parameters
(
self
):
original_waveform
=
self
.
waveform_generator
.
frequency_domain_strain
(
parameters
=
self
.
simulation_parameters
)
new_waveform
=
self
.
waveform_generator
.
time_domain_strain
(
parameters
=
self
.
simulation_parameters
)
self
.
assertNotEqual
(
original_waveform
,
new_waveform
)
def
test_time_domain_caching_and_using_frequency_domain_strain_without_parameters
(
self
):
original_waveform
=
self
.
waveform_generator
.
time_domain_strain
(
parameters
=
self
.
simulation_parameters
)
new_waveform
=
self
.
waveform_generator
.
frequency_domain_strain
()
self
.
assertNotEqual
(
original_waveform
,
new_waveform
)
def
test_time_domain_caching_and_using_frequency_domain_strain_with_parameters
(
self
):
original_waveform
=
self
.
waveform_generator
.
time_domain_strain
(
parameters
=
self
.
simulation_parameters
)
new_waveform
=
self
.
waveform_generator
.
frequency_domain_strain
(
parameters
=
self
.
simulation_parameters
)
self
.
assertNotEqual
(
original_waveform
,
new_waveform
)
if
__name__
==
'
__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