示例#1
0
 def test_check_registered_long_list(self):
     result = ['+CREG: 5,"5585","404EF4D",6',
               '+CREG: 5,"5585","404C816",6',
               '+CREG: 5,"5585","404C790",6',
               '+CREG: 5,"5585","404C816",6',
               '+CREG: 5,"5585","404EF4D",6',
               '+CREG: 5,"5585","404C78A",6',
               '+CREG: 5,"5585","404C790",6',
               '+CREG: 5,"5585","404C816",6',
               '+CREG: 2',
               '+CREG: 5,"5585","404C790",6',
               '+CREG: 2,5,"5585","404C790",6']
     registered = Modem._check_registered_helper('+CREG', result)
     assert(registered)
示例#2
0
 def test_registered_basic_unregistered_string(self):
     # This should force strips left and right, but the return value will
     # still be false since 3 is elem 1 in [2, 3, 2]
     result = '2, 3, 2'
     registered = Modem._check_registered_helper('+CREG', result)
     assert(registered == False)
示例#3
0
 def test_registered_empty_list(self):
     result = []
     with pytest.raises(SerialError) as e:
         registered = Modem._check_registered_helper('+CREG', result)
示例#4
0
 def test_check_registered_string(self):
     result = '+CREG: 2,5,"5585","404C790",6'
     registered = Modem._check_registered_helper('+CREG', result)
     assert(registered)