def test_get_timedelta(self): session = nitclk.SessionReference(SESSION_NUM_FOR_TEST) self.patched_library.niTClk_GetAttributeViReal64.side_effect = self.side_effects_helper.niTClk_GetAttributeViReal64 attribute_id = 11 test_number = 4.2 self.side_effects_helper['GetAttributeViReal64']['value'] = test_number attr_timedelta = session.sample_clock_delay assert (attr_timedelta.total_seconds() == test_number) self.patched_library.niTClk_GetAttributeViReal64.assert_called_once_with( _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViStringMatcher(''), _matchers.ViAttrMatcher(attribute_id), _matchers.ViReal64PointerMatcher())
def test_get_vi_real64(self): session = nitclk.SessionReference(SESSION_NUM_FOR_TEST) self.patched_library.niTClk_GetAttributeViReal64.side_effect = self.side_effects_helper.niTClk_GetAttributeViReal64 attribute_id = 8 test_number = 4.2 self.side_effects_helper['GetAttributeViReal64']['value'] = test_number attr_val = session.tclk_actual_period assert (attr_val == test_number) self.patched_library.niTClk_GetAttributeViReal64.assert_called_once_with( _matchers.ViSessionMatcher(SESSION_NUM_FOR_TEST), _matchers.ViStringMatcher(''), _matchers.ViAttrMatcher(attribute_id), _matchers.ViReal64PointerMatcher())