コード例 #1
0
def test_issues_warning_if_interrupt_enabled_when_pin_is_in_immediate_read_mode(b, p):
    with chip[b][p] as pin:
        pin.bank.read_mode = immediate_read
        
        with catch_warnings(record=True) as warnings:
            issue_warnings(u"always")
            
            pin.enable_interrupts(value=1)
            
            assert len(warnings) > 0
コード例 #2
0
def test_issues_warning_if_interrupt_enabled_when_pin_is_in_immediate_read_mode(
        b, p):
    with chip[b][p] as pin:
        pin.bank.read_mode = immediate_read

        with catch_warnings(record=True) as warnings:
            issue_warnings(u"always")

            pin.enable_interrupts(value=1)

            assert len(warnings) > 0
コード例 #3
0
def test_issues_no_warning_if_interrupt_enabled_when_pin_is_in_deferred_read_mode(b, p):
    with chip[b][p] as pin:
        pin.bank.read_mode = deferred_read
        
        with catch_warnings(record=True) as warnings:
            issue_warnings(u"always")
            
            pin.enable_interrupts()
            
            print warnings
            assert len(warnings) == 0
コード例 #4
0
def test_issues_no_warning_if_interrupt_enabled_when_pin_is_in_deferred_read_mode(
        b, p):
    with chip[b][p] as pin:
        pin.bank.read_mode = deferred_read

        with catch_warnings(record=True) as warnings:
            issue_warnings(u"always")

            pin.enable_interrupts()

            print warnings
            assert len(warnings) == 0
コード例 #5
0
def test_issues_no_warning_if_interrupt_enabled_when_pin_is_in_custom_read_mode(b, p):
    def custom_read_mode(f):
        pass
    
    with chip[b][p] as pin:
        pin.bank.read_mode = custom_read_mode
        
        with catch_warnings(record=True) as warnings:
            issue_warnings(u"always")
            
            pin.enable_interrupts()
            
            assert len(warnings) == 0
コード例 #6
0
def test_issues_no_warning_if_interrupt_enabled_when_pin_is_in_custom_read_mode(
        b, p):
    def custom_read_mode(f):
        pass

    with chip[b][p] as pin:
        pin.bank.read_mode = custom_read_mode

        with catch_warnings(record=True) as warnings:
            issue_warnings(u"always")

            pin.enable_interrupts()

            assert len(warnings) == 0