Beispiel #1
0
    def test_decode_cell(self):
        value = decode_cellid(b'\x00\x016\x00\x00\x00\x01\x00\x00\x00\x01')
        self.assertEqual(value, (Radio.gsm, 310, 0, 1, 1))
        self.assertEqual(type(value[0]), Radio)

        value = decode_cellid(b'\x02\x016\x00\x01\x00\x0c\x00\x00\x00\x00')
        self.assertEqual(value, (Radio.wcdma, 310, 1, 12, 0))
        self.assertEqual(type(value[0]), Radio)
Beispiel #2
0
    def test_decode_cell(self):
        value = decode_cellid(b'\x00\x016\x00\x00\x00\x01\x00\x00\x00\x01')
        self.assertEqual(value, (Radio.gsm, 310, 0, 1, 1))
        self.assertEqual(type(value[0]), Radio)

        value = decode_cellid(b'\x02\x016\x00\x01\x00\x0c\x00\x00\x00\x00')
        self.assertEqual(value, (Radio.wcdma, 310, 1, 12, 0))
        self.assertEqual(type(value[0]), Radio)
Beispiel #3
0
    def test_decode_cell(self):
        value = decode_cellid(b"\x00\x016\x00\x00\x00\x01\x00\x00\x00\x01")
        assert value == (Radio.gsm, 310, 0, 1, 1)
        assert type(value[0]) is Radio

        value = decode_cellid(b"\x02\x016\x00\x01\x00\x0c\x00\x00\x00\x00")
        assert value == (Radio.wcdma, 310, 1, 12, 0)
        assert type(value[0]) is Radio
Beispiel #4
0
    def test_decode_cell(self):
        value = decode_cellid(b'\x00\x016\x00\x00\x00\x01\x00\x00\x00\x01')
        assert value == (Radio.gsm, 310, 0, 1, 1)
        assert type(value[0]) is Radio

        value = decode_cellid(b'\x02\x016\x00\x01\x00\x0c\x00\x00\x00\x00')
        assert value == (Radio.wcdma, 310, 1, 12, 0)
        assert type(value[0]) is Radio
Beispiel #5
0
    def test_max(self):
        bit16 = 2**16 - 1
        bit32 = 2**32 - 1

        value = encode_cellarea(Radio.wcdma,
                                bit16,
                                bit16,
                                bit16,
                                codec='base64')
        self.assertEqual(value, b'Av///////w==')

        value = encode_cellid(Radio.wcdma,
                              bit16,
                              bit16,
                              bit16,
                              bit32,
                              codec='base64')
        self.assertEqual(value, b'Av////////////8=')

        value = decode_cellarea(b'Av///////w==', codec='base64')
        self.assertEqual(value, (Radio.wcdma, bit16, bit16, bit16))
        self.assertEqual(type(value[0]), Radio)

        value = decode_cellid(b'Av////////////8=', codec='base64')
        self.assertEqual(value, (Radio.wcdma, bit16, bit16, bit16, bit32))
        self.assertEqual(type(value[0]), Radio)
Beispiel #6
0
    def test_max(self):
        bit16 = 2**16 - 1
        bit32 = 2**32 - 1

        value = encode_cellarea(Radio.wcdma,
                                bit16,
                                bit16,
                                bit16,
                                codec="base64")
        assert value == b"Av///////w=="

        value = encode_cellid(Radio.wcdma,
                              bit16,
                              bit16,
                              bit16,
                              bit32,
                              codec="base64")
        assert value == b"Av////////////8="

        value = decode_cellarea(b"Av///////w==", codec="base64")
        assert value == (Radio.wcdma, bit16, bit16, bit16)
        assert type(value[0]) is Radio

        value = decode_cellid(b"Av////////////8=", codec="base64")
        assert value == (Radio.wcdma, bit16, bit16, bit16, bit32)
        assert type(value[0]) is Radio
Beispiel #7
0
    def test_min(self):
        value = encode_cellid(Radio.gsm, 0, 0, 0, 0, codec='base64')
        self.assertEqual(value, b'AAAAAAAAAAAAAAA=')

        value = decode_cellid(b'AAAAAAAAAAAAAAA=', codec='base64')
        self.assertEqual(value, (Radio.gsm, 0, 0, 0, 0))
        self.assertEqual(type(value[0]), Radio)
Beispiel #8
0
    def test_max(self):
        bit16 = 2 ** 16 - 1
        bit32 = 2 ** 32 - 1

        value = encode_cellid(
            Radio.wcdma, bit16, bit16, bit16, bit32, codec='base64')
        self.assertEqual(value, b'Av////////////8=')

        value = decode_cellid(b'Av////////////8=', codec='base64')
        self.assertEqual(value, (Radio.wcdma, bit16, bit16, bit16, bit32))
        self.assertEqual(type(value[0]), Radio)
Beispiel #9
0
    def test_min(self):
        value = encode_cellarea(Radio.gsm, 0, 0, 0, codec='base64')
        self.assertEqual(value, b'AAAAAAAAAA==')

        value = encode_cellid(Radio.gsm, 0, 0, 0, 0, codec='base64')
        self.assertEqual(value, b'AAAAAAAAAAAAAAA=')

        value = decode_cellarea(b'AAAAAAAAAA==', codec='base64')
        self.assertEqual(value, (Radio.gsm, 0, 0, 0))
        self.assertEqual(type(value[0]), Radio)

        value = decode_cellid(b'AAAAAAAAAAAAAAA=', codec='base64')
        self.assertEqual(value, (Radio.gsm, 0, 0, 0, 0))
        self.assertEqual(type(value[0]), Radio)
Beispiel #10
0
    def test_min(self):
        value = encode_cellarea(Radio.gsm, 0, 0, 0, codec='base64')
        assert value == b'AAAAAAAAAA=='

        value = encode_cellid(Radio.gsm, 0, 0, 0, 0, codec='base64')
        assert value == b'AAAAAAAAAAAAAAA='

        value = decode_cellarea(b'AAAAAAAAAA==', codec='base64')
        assert value == (Radio.gsm, 0, 0, 0)
        assert type(value[0]) is Radio

        value = decode_cellid(b'AAAAAAAAAAAAAAA=', codec='base64')
        assert value == (Radio.gsm, 0, 0, 0, 0)
        assert type(value[0]) is Radio
Beispiel #11
0
    def test_min(self):
        value = encode_cellarea(Radio.gsm, 0, 0, 0, codec="base64")
        assert value == b"AAAAAAAAAA=="

        value = encode_cellid(Radio.gsm, 0, 0, 0, 0, codec="base64")
        assert value == b"AAAAAAAAAAAAAAA="

        value = decode_cellarea(b"AAAAAAAAAA==", codec="base64")
        assert value == (Radio.gsm, 0, 0, 0)
        assert type(value[0]) is Radio

        value = decode_cellid(b"AAAAAAAAAAAAAAA=", codec="base64")
        assert value == (Radio.gsm, 0, 0, 0, 0)
        assert type(value[0]) is Radio
    def test_min(self):
        value = encode_cellarea(Radio.gsm, 0, 0, 0, codec='base64')
        assert value == b'AAAAAAAAAA=='

        value = encode_cellid(Radio.gsm, 0, 0, 0, 0, codec='base64')
        assert value == b'AAAAAAAAAAAAAAA='

        value = decode_cellarea(b'AAAAAAAAAA==', codec='base64')
        assert value == (Radio.gsm, 0, 0, 0)
        assert type(value[0]) is Radio

        value = decode_cellid(b'AAAAAAAAAAAAAAA=', codec='base64')
        assert value == (Radio.gsm, 0, 0, 0, 0)
        assert type(value[0]) is Radio
Beispiel #13
0
    def test_max(self):
        bit16 = 2 ** 16 - 1
        bit32 = 2 ** 32 - 1

        value = encode_cellarea(
            Radio.wcdma, bit16, bit16, bit16, codec='base64')
        assert value == b'Av///////w=='

        value = encode_cellid(
            Radio.wcdma, bit16, bit16, bit16, bit32, codec='base64')
        assert value == b'Av////////////8='

        value = decode_cellarea(b'Av///////w==', codec='base64')
        assert value == (Radio.wcdma, bit16, bit16, bit16)
        assert type(value[0]) is Radio

        value = decode_cellid(b'Av////////////8=', codec='base64')
        assert value == (Radio.wcdma, bit16, bit16, bit16, bit32)
        assert type(value[0]) is Radio