def test_partition_params4(self): """Forth test of the pipe_control.value.partition_params() function.""" # Set the current data pipe to 'mf'. pipes.switch('mf') # The parameters and values. param = ['Dx', 's2', 'csa'] val = [1e7, 0.8, -160e-6] # Partition. spin_params, spin_values, other_params, other_values = value.partition_params(val, param) # Tests. self.assertEqual(spin_params, ['s2', 'csa']) self.assertEqual(spin_values, [0.8, -160e-6]) self.assertEqual(other_params, ['Dx']) self.assertEqual(other_values, [1e7])
def test_partition_params2(self): """Second test of the pipe_control.value.partition_params() function.""" # Set the current data pipe to 'mf'. pipes.switch('mf') # The parameters and values. param = ['Dx'] val = [1e7] # Partition. spin_params, spin_values, other_params, other_values = value.partition_params(val, param) # Tests. self.assertEqual(spin_params, []) self.assertEqual(spin_values, []) self.assertEqual(other_params, ['Dx']) self.assertEqual(other_values, [1e7])
def test_partition_params4(self): """Forth test of the pipe_control.value.partition_params() function.""" # Set the current data pipe to 'mf'. pipes.switch('mf') # The parameters and values. param = ['Dx', 's2', 'csa'] val = [1e7, 0.8, -160e-6] # Partition. spin_params, spin_values, other_params, other_values = value.partition_params( val, param) # Tests. self.assertEqual(spin_params, ['s2', 'csa']) self.assertEqual(spin_values, [0.8, -160e-6]) self.assertEqual(other_params, ['Dx']) self.assertEqual(other_values, [1e7])
def test_partition_params2(self): """Second test of the pipe_control.value.partition_params() function.""" # Set the current data pipe to 'mf'. pipes.switch('mf') # The parameters and values. param = ['Dx'] val = [1e7] # Partition. spin_params, spin_values, other_params, other_values = value.partition_params( val, param) # Tests. self.assertEqual(spin_params, []) self.assertEqual(spin_values, []) self.assertEqual(other_params, ['Dx']) self.assertEqual(other_values, [1e7])