Example #1
0
 def test_trace_header_delegation(self, delegatee):
     delegatee.configure_mock(**{'trace_header.return_value': TraceHeaderRev1()})
     trace_index = 42
     dd = DelegatingDataset(delegatee)
     ts = dd.trace_header(trace_index)
     delegatee.trace_header.assert_called_once_with(trace_index)
     assert are_equal(ts, TraceHeaderRev1())
Example #2
0
 def test_trace_samples_delegation(self, delegatee):
     delegatee.configure_mock(**{'trace_samples.return_value': [17, 3, 9]})
     trace_index = 42
     start = 5
     stop = 10
     dd = DelegatingDataset(delegatee)
     ts = dd.trace_samples(trace_index, start, stop)
     delegatee.trace_samples.assert_called_once_with(trace_index, start, stop)
     assert ts == [17, 3, 9]
Example #3
0
 def test_data_sample_format_int8(self, delegatee):
     p = PropertyMock(return_value=BinaryReelHeader(
         data_sample_format=DataSampleFormat.INT8))
     type(delegatee).binary_reel_header = p
     dd = DelegatingDataset(delegatee)
     dsf_read = dd.data_sample_format
     assert dsf_read == SegYType.INT8
Example #4
0
 def test_num_traces_delegation(self, delegatee):
     delegatee.configure_mock(**{'num_traces.return_value': 543})
     dd = DelegatingDataset(delegatee)
     nt = dd.num_traces()
     delegatee.num_traces.assert_called_once_with()
     assert nt == 543
Example #5
0
 def test_trace_indexes_delegation(self, delegatee):
     delegatee.configure_mock(**{'trace_indexes.return_value': range(1, 900)})
     dd = DelegatingDataset(delegatee)
     ti = dd.trace_indexes()
     delegatee.trace_indexes.assert_called_once_with()
     assert ti == range(1, 900)
Example #6
0
 def test_num_traces_delegation(self, delegatee):
     delegatee.configure_mock(**{'num_traces.return_value': 543})
     dd = DelegatingDataset(delegatee)
     nt = dd.num_traces()
     delegatee.num_traces.assert_called_once_with()
     assert nt == 543
Example #7
0
 def test_source_is_delagatee(self, delegatee):
     dd = DelegatingDataset(delegatee)
     assert dd.source is delegatee