Beispiel #1
0
 def test_attributes_which_are_not_arguments_can_be_assigned(self):
     at.REF_0_5(11).some_attribute = 20
Beispiel #2
0
 def test_init_by_arg(self):
     cmd = at.REF_0_5(3)
     self.assertEqual(cmd.input, 3)
Beispiel #3
0
 def test_pack(self):
     self.assertEqual(at.REF_0_5(20)._pack(100), b'AT*REF=100,20\r')
Beispiel #4
0
 def test_command_arguments_can_not_be_assigned(self):
     with self.assertRaises(AttributeError):
         at.REF_0_5(10).input = 11
Beispiel #5
0
    def test_different_commands_with_same_arguments_are_different(self):
        class REF_0_52(base.ATCommand):

            input = parameters.Int32()

        self.assertNotEqual(at.REF_0_5(3), REF_0_52(3))
Beispiel #6
0
 def test_not_equal_to_other_type(self):
     self.assertNotEqual(at.REF_0_5(17), 17)
Beispiel #7
0
 def test_equal(self):
     self.assertEqual(at.REF_0_5(20), at.REF_0_5(20))
Beispiel #8
0
 def test_unequal_different_argument(self):
     self.assertNotEqual(at.REF_0_5(10), at.REF_0_5(12))
Beispiel #9
0
 def test_repr(self):
     self.assertEqual(repr(at.REF_0_5(3)), 'REF(input=3)')
Beispiel #10
0
 def test_wrong_type_raises_TypeError(self):
     with self.assertRaises(TypeError):
         at.REF_0_5(0.5)
Beispiel #11
0
 def test_duplicate_value_raises_TypeError(self):
     with self.assertRaises(TypeError):
         at.REF_0_5(3, input=7)
Beispiel #12
0
 def test_pack_equal(self):
     self.assertEqual(at.REF()._pack(4),
                      at.REF_0_5(at.REF_0_5.input.default)._pack(4))
Beispiel #13
0
 def test_too_many_arguments_raises_TypeError(self):
     with self.assertRaises(TypeError):
         at.REF_0_5(3, 7)