Skip to content
Snippets Groups Projects
Commit b8a17695 authored by Moritz's avatar Moritz
Browse files

Added some tests for caching

parent bd1dfb91
No related branches found
No related tags found
1 merge request!466Fixes a bug with the cache when calling frequency_domain_strain and time domain strain after each other
Pipeline #60193 passed
......@@ -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__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment