예제 #1
0
 def test_which_int_set(self):
     i = Interface('/foo[0:4]')
     i['/foo[0]', 'interface', 'io'] = [0, 'out']
     i['/foo[1]', 'interface', 'io'] = [0, 'in']
     i['/foo[2]', 'interface', 'io'] = [1, 'in']
     i['/foo[3]', 'interface', 'io'] = [1, 'out']
     assert i.which_int('/foo[0:2]') == {0}
     assert i.which_int('/foo[0:4]') == {0, 1}
예제 #2
0
 def test_which_int_set(self):
     i = Interface('/foo[0:4]')
     i['/foo[0]', 'interface', 'io'] = [0, 'out']
     i['/foo[1]', 'interface', 'io'] = [0, 'in']
     i['/foo[2]', 'interface', 'io'] = [1, 'in']
     i['/foo[3]', 'interface', 'io'] = [1, 'out']
     assert i.which_int('/foo[0:2]') == {0}
     assert i.which_int('/foo[0:4]') == {0, 1}
예제 #3
0
 def test_which_int_unset(self):
     i = Interface('/foo[0:4]')
     assert i.which_int('/foo[0:2]') == set()
예제 #4
0
 def test_which_int_unset(self):
     i = Interface('/foo[0:4]')
     assert i.which_int('/foo[0:2]') == set()