def test_wifi(self): wifis = WifiShardFactory.build_batch(2) query = Query(wifi=[{ 'macAddress': wifi.mac, 'age': 2000, 'signalStrength': -90, 'ssid': 'wifi' } for wifi in wifis]) data = OUTBOUND_SCHEMA.deserialize(query.json()) assert (data == { 'wifiAccessPoints': [{ 'macAddress': wifis[0].mac, 'age': 2000, 'signalStrength': -90, 'ssid': 'wifi', }, { 'macAddress': wifis[1].mac, 'age': 2000, 'signalStrength': -90, 'ssid': 'wifi', }], 'fallbacks': { 'lacf': True }, })
def test_cell(self): cell = CellShardFactory.build(radio=Radio.lte) query = Query(cell=[{ 'radioType': cell.radio, 'mobileCountryCode': cell.mcc, 'mobileNetworkCode': cell.mnc, 'locationAreaCode': cell.lac, 'cellId': cell.cid, 'age': 1200, 'signalStrength': -70, 'timingAdvance': 15, 'unknown_field': 'foo' }]) data = self._call(query.json()) assert (data == { 'cellTowers': [{ 'radioType': cell.radio.name, 'mobileCountryCode': cell.mcc, 'mobileNetworkCode': cell.mnc, 'locationAreaCode': cell.lac, 'cellId': cell.cid, 'age': 1200, 'signalStrength': -70, 'timingAdvance': 15, }], 'considerIp': False, })
def test_blue(self): blues = BlueShardFactory.build_batch(2) query = Query( blue=[ { "macAddress": blue.mac, "age": 1500, "name": "beacon", "signalStrength": -90, } for blue in blues ] ) data = self._call(query.json()) assert data == { "bluetoothBeacons": [ { "macAddress": blues[0].mac, "age": 1500, "name": "beacon", "signalStrength": -90, }, { "macAddress": blues[1].mac, "age": 1500, "name": "beacon", "signalStrength": -90, }, ], "fallbacks": {"lacf": True}, }
def test_cell(self): cell = CellShardFactory.build(radio=Radio.lte) query = Query( cell=[ { "radioType": cell.radio, "mobileCountryCode": cell.mcc, "mobileNetworkCode": cell.mnc, "locationAreaCode": cell.lac, "cellId": cell.cid, "age": 1200, "signalStrength": -70, "timingAdvance": 15, "unknown_field": "foo", } ] ) data = self._call(query.json()) assert data == { "cellTowers": [ { "radioType": cell.radio.name, "mobileCountryCode": cell.mcc, "mobileNetworkCode": cell.mnc, "locationAreaCode": cell.lac, "cellId": cell.cid, "age": 1200, "signalStrength": -70, "timingAdvance": 15, } ], "considerIp": False, }
def test_wifi(self): wifis = WifiShardFactory.build_batch(2) query = Query( wifi=[ { "macAddress": wifi.mac, "age": 2000, "channel": 11, "signalStrength": -90, "signalToNoiseRatio": 13, } for wifi in wifis ] ) data = self._call(query.json()) assert data == { "wifiAccessPoints": [ { "macAddress": wifis[0].mac, "age": 2000, "channel": 11, "signalStrength": -90, "signalToNoiseRatio": 13, }, { "macAddress": wifis[1].mac, "age": 2000, "channel": 11, "signalStrength": -90, "signalToNoiseRatio": 13, }, ], "considerIp": False, }
def test_wifi(self): wifis = WifiShardFactory.build_batch(2) query = Query(wifi=[{ "macAddress": wifi.mac, "channel": 3, "frequency": 2412, "signalStrength": -70, "signalToNoiseRatio": 13, "ssid": "wifi", } for wifi in wifis]) data = self._call(query.json()) assert data == { "wifi": [ { "bssid": wifis[0].mac, "channel": 3, "frequency": 2412, "signal": -70, "signalToNoiseRatio": 13, }, { "bssid": wifis[1].mac, "channel": 3, "frequency": 2412, "signal": -70, "signalToNoiseRatio": 13, }, ], "fallbacks": { "lacf": True }, "token": None, }
def test_cell(self): cell = CellShardFactory.build(radio=Radio.lte) query = Query(cell=[{ "radioType": cell.radio, "mobileCountryCode": cell.mcc, "mobileNetworkCode": cell.mnc, "locationAreaCode": cell.lac, "cellId": cell.cid, "asu": 17, "primaryScramblingCode": 5, "signalStrength": -70, "timingAdvance": 15, "unknown_field": "foo", }]) data = self._call(query.json()) assert data == { "cells": [{ "radio": cell.radio.name, "mcc": cell.mcc, "mnc": cell.mnc, "lac": cell.lac, "cid": cell.cid, "asu": 17, "psc": 5, "signal": -70, "tA": 15, }], "fallbacks": { "lacf": True }, "token": None, }
def test_wifi(self): wifis = WifiShardFactory.build_batch(2) query = Query(wifi=[{ 'macAddress': wifi.mac, 'channel': 3, 'frequency': 2412, 'signalStrength': -70, 'signalToNoiseRatio': 13, 'ssid': 'wifi' } for wifi in wifis]) data = self._call(query.json()) assert (data == { 'wifi': [{ 'bssid': wifis[0].mac, 'channel': 3, 'frequency': 2412, 'signal': -70, 'signalToNoiseRatio': 13, }, { 'bssid': wifis[1].mac, 'channel': 3, 'frequency': 2412, 'signal': -70, 'signalToNoiseRatio': 13, }], 'fallbacks': { 'lacf': True }, 'token': None, })
def test_wifi(self): wifis = WifiShardFactory.build_batch(2) query = Query( wifi=[ { "macAddress": wifi.mac, "age": 2000, "signalStrength": -90, "ssid": "wifi", } for wifi in wifis ] ) data = self._call(query.json()) assert data == { "wifiAccessPoints": [ { "macAddress": wifis[0].mac, "age": 2000, "signalStrength": -90, "ssid": "wifi", }, { "macAddress": wifis[1].mac, "age": 2000, "signalStrength": -90, "ssid": "wifi", }, ], "fallbacks": {"lacf": True}, }
def test_wifi(self): wifis = WifiShardFactory.build_batch(2) query = Query(wifi=[{ 'macAddress': wifi.mac, 'age': 2000, 'channel': 11, 'signalStrength': -90, 'signalToNoiseRatio': 13 } for wifi in wifis]) data = self._call(query.json()) assert (data == { 'wifiAccessPoints': [{ 'macAddress': wifis[0].mac, 'age': 2000, 'channel': 11, 'signalStrength': -90, 'signalToNoiseRatio': 13, }, { 'macAddress': wifis[1].mac, 'age': 2000, 'channel': 11, 'signalStrength': -90, 'signalToNoiseRatio': 13, }], 'considerIp': False, })
def test_blue(self): blues = BlueShardFactory.build_batch(2) query = Query(blue=[{ 'macAddress': blue.mac, 'age': 1500, 'name': 'beacon', 'signalStrength': -90 } for blue in blues]) data = OUTBOUND_SCHEMA.deserialize(query.json()) assert (data == { 'bluetoothBeacons': [{ 'macAddress': blues[0].mac, 'age': 1500, 'name': 'beacon', 'signalStrength': -90, }, { 'macAddress': blues[1].mac, 'age': 1500, 'name': 'beacon', 'signalStrength': -90, }], 'fallbacks': { 'lacf': True }, })
def test_wifi(self): wifis = WifiShardFactory.build_batch(2) query = Query(wifi=[ {'macAddress': wifi.mac, 'channel': 3, 'frequency': 2412, 'signalStrength': -70, 'signalToNoiseRatio': 13, 'ssid': 'wifi'} for wifi in wifis]) data = self._call(query.json()) assert (data == { 'wifi': [{ 'bssid': wifis[0].mac, 'channel': 3, 'frequency': 2412, 'signal': -70, 'signalToNoiseRatio': 13, }, { 'bssid': wifis[1].mac, 'channel': 3, 'frequency': 2412, 'signal': -70, 'signalToNoiseRatio': 13, }], 'fallbacks': {'lacf': True}, 'token': None, })
def test_cell(self): cell = CellShardFactory.build(radio=Radio.lte) query = Query(cell=[ {'radioType': cell.radio, 'mobileCountryCode': cell.mcc, 'mobileNetworkCode': cell.mnc, 'locationAreaCode': cell.lac, 'cellId': cell.cid, 'age': 1200, 'signalStrength': -70, 'timingAdvance': 15, 'unknown_field': 'foo'}]) data = self._call(query.json()) assert (data == { 'cellTowers': [{ 'radioType': cell.radio.name, 'mobileCountryCode': cell.mcc, 'mobileNetworkCode': cell.mnc, 'locationAreaCode': cell.lac, 'cellId': cell.cid, 'age': 1200, 'signalStrength': -70, 'timingAdvance': 15, }], 'considerIp': False, })
def test_cell(self): cell = CellShardFactory.build(radio=Radio.lte) query = Query(cell=[ {'radioType': cell.radio, 'mobileCountryCode': cell.mcc, 'mobileNetworkCode': cell.mnc, 'locationAreaCode': cell.lac, 'cellId': cell.cid, 'asu': 17, 'primaryScramblingCode': 5, 'signalStrength': -70, 'timingAdvance': 15, 'unknown_field': 'foo'}]) data = self._call(query.json()) assert (data == { 'cells': [{ 'radio': cell.radio.name, 'mcc': cell.mcc, 'mnc': cell.mnc, 'lac': cell.lac, 'cid': cell.cid, 'asu': 17, 'psc': 5, 'signal': -70, 'tA': 15, }], 'fallbacks': {'lacf': True}, 'token': None, })
def test_cell(self): cell = CellShardFactory.build(radio=Radio.lte) query = Query(cell=[{ 'radioType': cell.radio, 'mobileCountryCode': cell.mcc, 'mobileNetworkCode': cell.mnc, 'locationAreaCode': cell.lac, 'cellId': cell.cid, 'asu': 17, 'primaryScramblingCode': 5, 'signalStrength': -70, 'timingAdvance': 15, 'unknown_field': 'foo' }]) data = self._call(query.json()) assert (data == { 'cells': [{ 'radio': cell.radio.name, 'mcc': cell.mcc, 'mnc': cell.mnc, 'lac': cell.lac, 'cid': cell.cid, 'asu': 17, 'psc': 5, 'signal': -70, 'tA': 15, }], 'fallbacks': { 'lacf': True }, 'token': None, })
def test_cell(self): cell = CellShardFactory.build(radio=Radio.lte) query = Query(cell=[{ 'radioType': cell.radio, 'mobileCountryCode': cell.mcc, 'mobileNetworkCode': cell.mnc, 'locationAreaCode': cell.lac, 'cellId': cell.cid, 'age': 1200, 'asu': None, 'primaryScramblingCode': 5, 'signalStrength': -70, 'timingAdvance': 15, 'unknown_field': 'foo' }]) data = OUTBOUND_SCHEMA.deserialize(query.json()) assert (data == { 'cellTowers': [{ 'radioType': cell.radio.name, 'mobileCountryCode': cell.mcc, 'mobileNetworkCode': cell.mnc, 'locationAreaCode': cell.lac, 'cellId': cell.cid, 'primaryScramblingCode': 5, 'age': 1200, 'signalStrength': -70, 'timingAdvance': 15, }], 'fallbacks': { 'lacf': True }, })
def test_wifi(self): wifis = WifiShardFactory.build_batch(2) query = Query(wifi=[ {'macAddress': wifi.mac, 'age': 2000, 'signalStrength': -90, 'ssid': 'wifi'} for wifi in wifis]) data = self._call(query.json()) assert (data == { 'wifiAccessPoints': [{ 'macAddress': wifis[0].mac, 'age': 2000, 'signalStrength': -90, 'ssid': 'wifi', }, { 'macAddress': wifis[1].mac, 'age': 2000, 'signalStrength': -90, 'ssid': 'wifi', }], 'fallbacks': {'lacf': True}, })
def test_blue(self): blues = BlueShardFactory.build_batch(2) query = Query(blue=[ {'macAddress': blue.mac, 'age': 1500, 'name': 'beacon', 'signalStrength': -90} for blue in blues]) data = self._call(query.json()) assert (data == { 'bluetoothBeacons': [{ 'macAddress': blues[0].mac, 'age': 1500, 'name': 'beacon', 'signalStrength': -90, }, { 'macAddress': blues[1].mac, 'age': 1500, 'name': 'beacon', 'signalStrength': -90, }], 'fallbacks': {'lacf': True}, })
def test_wifi(self): wifis = WifiShardFactory.build_batch(2) query = Query(wifi=[ {'macAddress': wifi.mac, 'age': 2000, 'channel': 11, 'signalStrength': -90, 'signalToNoiseRatio': 13} for wifi in wifis]) data = self._call(query.json()) assert (data == { 'wifiAccessPoints': [{ 'macAddress': wifis[0].mac, 'age': 2000, 'channel': 11, 'signalStrength': -90, 'signalToNoiseRatio': 13, }, { 'macAddress': wifis[1].mac, 'age': 2000, 'channel': 11, 'signalStrength': -90, 'signalToNoiseRatio': 13, }], 'considerIp': False, })
def test_query(self): query = Query() data = self._call(query.json()) assert data == {'considerIp': False}
def test_query(self): query = Query() data = OUTBOUND_SCHEMA.deserialize(query.json()) assert data == {'fallbacks': {'lacf': True}}
def test_query(self): query = Query() data = self._call(query.json()) assert data == {'fallbacks': {'lacf': True}, 'token': None}
def test_query(self): query = Query() data = self._call(query.json()) assert data == {"fallbacks": {"lacf": True}, "token": None}
def test_query(self): query = Query() data = self._call(query.json()) assert data == {"considerIp": False}
def test_query(self): query = Query() data = self._call(query.json()) assert data == {'fallbacks': {'lacf': True}, 'token': None}