def test_prepare_extensions(self, data, p_result): model = _regeo_code_model.PreparedReGeoCodeRequestParams() model.prepare_extensions(data) assert model.extensions == data assert model.prepared_extensions == p_result
def test_generate_params(self, data, result): model = _regeo_code_model.PreparedReGeoCodeRequestParams() model.prepare(**data) for k, v in iteritems(result): assert model.params[k] == v assert len(model.params) == len(result)
def test_prepare_batch(self, data, result, p_result): model = _regeo_code_model.PreparedReGeoCodeRequestParams() model.prepare_batch(data) assert model.batch == result assert model.prepared_batch == p_result
def test_preapre_home_or_corp(self, data, result, p_result): model = _regeo_code_model.PreparedReGeoCodeRequestParams() model.prepare_home_or_corp(data) model.extensions = ExtensionFlag.ALL assert model.home_or_corp == result assert model.prepared_home_or_corp == p_result
def test_prepare_road_level(self, data, result, p_result): model = _regeo_code_model.PreparedReGeoCodeRequestParams() model.prepare_road_level(data) model.extensions = ExtensionFlag.ALL assert model.road_level == result assert model.prepared_road_level == p_result
def test_prepare_poi_type(self, data, result, p_result): model = _regeo_code_model.PreparedReGeoCodeRequestParams() model.prepare_poi_type(data) model.extensions = ExtensionFlag.ALL assert model.poi_type == result assert model.prepared_poi_type == p_result
def test_prepared_no_extensions(self): model = _regeo_code_model.PreparedReGeoCodeRequestParams() model.prepare( location='123,45', radius=1000, batch=True, extensions=ExtensionFlag.BASE, poi_type='bbb|ccc', road_level=RoadLevel.ALL, home_or_corp=HomeOrCorpControl.OFF, ) assert model.prepared_home_or_corp is None assert model.prepared_road_level is None assert model.prepared_poi_type is None assert model.prepared_extensions is 'base'
def test_prepare(self): model = _regeo_code_model.PreparedReGeoCodeRequestParams() model.prepare( location='123,45', radius=1000, batch=True, extensions=ExtensionFlag.ALL, poi_type='bbb|ccc', road_level=RoadLevel.ALL, home_or_corp=HomeOrCorpControl.OFF, ) assert model.location == [(123, 45)] assert model.radius == 1000 assert model.batch == BatchFlag.ON assert model.extensions == ExtensionFlag.ALL assert model.poi_type == ['bbb', 'ccc'] assert model.road_level == RoadLevel.ALL assert model.home_or_corp == HomeOrCorpControl.OFF
def test_prepare_location(self, data, result, p_result): model = _regeo_code_model.PreparedReGeoCodeRequestParams() model.prepare_location(data) assert model.location == result assert model.prepared_location == p_result
def test_init_ok(self): model = _regeo_code_model.PreparedReGeoCodeRequestParams() assert (model.location == model.radius == model.batch == model.extensions == model.poi_type == model.road_level == model.home_or_corp is None)
def test_prepare_radius(self, data): model = _regeo_code_model.PreparedReGeoCodeRequestParams() model.prepare_radius(data) assert model.radius == data assert model.prepared_radius == data