def test_node_recorder_all_nodes(): recorder = NodeRecorder( file='/path/to/file', nodes='all', dofs=[1, 2, 3], response='vel', ) generated = recorder.tcl_code() expected = 'recorder Node -file {/path/to/file} -node {*}[getNodeTags] -dof 1 2 3 vel' assert generated == expected
def test_node_recorder(): recorder = NodeRecorder( file='/path/to/file', nodes=1, dofs=[1, 2], response='disp', ) generated = recorder.tcl_code() expected = 'recorder Node -file {/path/to/file} -node 1 -dof 1 2 disp' assert generated == expected
def test_node_recorder_windows_path(): recorder = NodeRecorder( file=R'C:\Scratch\displacement.dat', nodes=[1, 2, 3, 4, 5], dofs=[1, 2, 3, 4, 5, 6], response='disp', ) generated = recorder.tcl_code() expected = ( 'recorder Node -file {C:/Scratch/displacement.dat} ' '-node 1 2 3 4 5 -dof 1 2 3 4 5 6 disp' ) assert generated == expected
def test_node_recorder_all_nodes_delayed_file_then_format(): recorder = NodeRecorder(nodes='all', dofs=1, response='accel') generated = recorder.tcl_code().format(file='/path/to/file') expected = 'recorder Node -file {/path/to/file} -node {*}[getNodeTags] -dof 1 accel' assert generated == expected
def test_node_recorder_all_nodes_delayed_file(): recorder = NodeRecorder(nodes='all', dofs=1, response='accel') generated = recorder.tcl_code() expected = 'recorder Node -file {{{file!s}}} -node {{*}}[getNodeTags] -dof 1 accel' assert generated == expected
def test_node_recorder_delayed_file(): recorder = NodeRecorder(nodes=1, dofs=1, response='accel') generated = recorder.tcl_code() expected = 'recorder Node -file {{{file!s}}} -node 1 -dof 1 accel' assert generated == expected