Пример #1
0
 def test_wait_until_done(self):
     min_time = 4.2
     self.patched_library.niTClk_WaitUntilDone.side_effect = self.side_effects_helper.niTClk_WaitUntilDone
     nitclk.wait_until_done(multiple_session_references, min_time)
     self.patched_library.niTClk_WaitUntilDone.assert_called_once_with(
         _matchers.ViUInt32Matcher(len(multiple_sessions)),
         _matchers.ViSessionBufferMatcher(multiple_sessions),
         _matchers.ViReal64Matcher(min_time))
     return
Пример #2
0
 def test_synchronize_timedelta(self):
     min_time = datetime.timedelta(seconds=0.042)
     self.patched_library.niTClk_Synchronize.side_effect = self.side_effects_helper.niTClk_Synchronize
     nitclk.synchronize(multiple_session_references, min_time)
     self.patched_library.niTClk_Synchronize.assert_called_once_with(
         _matchers.ViUInt32Matcher(len(multiple_sessions)),
         _matchers.ViSessionBufferMatcher(multiple_sessions),
         _matchers.ViReal64Matcher(min_time.total_seconds()))
     return
Пример #3
0
 def test_synchronize_to_sync_pulse_sender(self):
     min_time = 0.042
     self.patched_library.niTClk_SynchronizeToSyncPulseSender.side_effect = self.side_effects_helper.niTClk_SynchronizeToSyncPulseSender
     nitclk.synchronize_to_sync_pulse_sender(multiple_sessions, min_time)
     self.patched_library.niTClk_SynchronizeToSyncPulseSender.assert_called_once_with(
         _matchers.ViUInt32Matcher(len(multiple_sessions)),
         _matchers.ViSessionBufferMatcher(multiple_sessions),
         _matchers.ViReal64Matcher(min_time))
     return
Пример #4
0
 def test_setup_for_sync_pulse_sender_synchronize(self):
     min_time = 0.042
     self.patched_library.niTClk_SetupForSyncPulseSenderSynchronize.side_effect = self.side_effects_helper.niTClk_SetupForSyncPulseSenderSynchronize
     nitclk.setup_for_sync_pulse_sender_synchronize(
         multiple_session_references, min_time)
     self.patched_library.niTClk_SetupForSyncPulseSenderSynchronize.assert_called_once_with(
         _matchers.ViUInt32Matcher(len(multiple_sessions)),
         _matchers.ViSessionBufferMatcher(multiple_sessions),
         _matchers.ViReal64Matcher(min_time))
     return
Пример #5
0
 def test_set_timedelta_as_timedelta(self):
     session = nitclk.SessionReference(SESSION_NUM_FOR_TEST)
     self.patched_library.niTClk_SetAttributeViReal64.side_effect = self.side_effects_helper.niTClk_SetAttributeViReal64
     attribute_id = 11
     test_number = 4.2
     session.sample_clock_delay = datetime.timedelta(seconds=test_number)
     self.patched_library.niTClk_SetAttributeViReal64.assert_called_once_with(
         _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST),
         _matchers.ViStringMatcher(''),
         _matchers.ViAttrMatcher(attribute_id),
         _matchers.ViReal64Matcher(test_number))
Пример #6
0
 def test_set_vi_real64(self):
     session = nitclk.SessionReference(SESSION_NUM_FOR_TEST)
     self.patched_library.niTClk_SetAttributeViReal64.side_effect = self.side_effects_helper.niTClk_SetAttributeViReal64
     attribute_id = 8
     test_number = 4.2
     session.tclk_actual_period = test_number
     self.patched_library.niTClk_SetAttributeViReal64.assert_called_once_with(
         _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST),
         _matchers.ViStringMatcher(''),
         _matchers.ViAttrMatcher(attribute_id),
         _matchers.ViReal64Matcher(test_number))