def set_conditions(self, url_params): """URLパラメータ(クエリストリング)の条件設定""" self.no_limited = UrlParamHelper.get_bool_param( 'no_lmt', url_params) # 管理種別の限定無し(管理物件・専任物件以外も含む) self.stations = UrlParamHelper.get_id_array_param('stn', url_params) # 駅ID self.walk_time = UrlParamHelper.get_int_param('wlk', url_params) # 駅徒歩時間 self.cities = UrlParamHelper.get_id_array_param('city', url_params) # 市区町村ID self.areas = UrlParamHelper.get_id_array_param('area', url_params) # エリアID self.landmarks = UrlParamHelper.get_id_array_param( 'ldmk', url_params) # ランドマークID self.north = UrlParamHelper.get_float_param('north', url_params) # 北緯 self.south = UrlParamHelper.get_float_param('south', url_params) # 南緯 self.east = UrlParamHelper.get_float_param('east', url_params) # 東経 self.west = UrlParamHelper.get_float_param('west', url_params) # 西経
def test_get_order_param(self): self.assertEqual( UrlParamHelper.get_order_param('odr', self.query_params), 'rent')
def set_conditions(self, url_params): """URLパラメータ(クエリストリング)の条件設定""" self.no_limited = UrlParamHelper.get_bool_param( 'no_lmt', url_params) # 管理種別の限定無し(管理物件・専任物件以外も含む) self.stations = UrlParamHelper.get_id_array_param('stn', url_params) # 駅ID self.walk_time = UrlParamHelper.get_int_param('wlk', url_params) # 駅徒歩時間 self.cities = UrlParamHelper.get_id_array_param('city', url_params) # 市区町村ID self.areas = UrlParamHelper.get_id_array_param('area', url_params) # エリアID self.landmarks = UrlParamHelper.get_id_array_param( 'ldmk', url_params) # ランドマークID self.north = UrlParamHelper.get_float_param('north', url_params) # 北緯 self.south = UrlParamHelper.get_float_param('south', url_params) # 南緯 self.east = UrlParamHelper.get_float_param('east', url_params) # 東経 self.west = UrlParamHelper.get_float_param('west', url_params) # 西経 self.elementary_school = UrlParamHelper.get_id_param( 'schl', url_params) # 小学校区ID self.building_types = UrlParamHelper.get_id_array_param( 'b_tp', url_params) # 建物種別ID self.building_age = UrlParamHelper.get_int_param('b_age', url_params) # 築年数 self.with_garage = UrlParamHelper.get_bool_param('grg', url_params) # 駐車場有り self.with_bike_parking = UrlParamHelper.get_bool_param( 'bike', url_params) # 駐輪場有り self.rent_lower = UrlParamHelper.get_int_param('l_rnt', url_params) # 賃料下限 self.rent_upper = UrlParamHelper.get_int_param('u_rnt', url_params) # 賃料上限 self.include_condo_fees = UrlParamHelper.get_bool_param( 'in_cnd', url_params) # 賃料条件に共益費含む self.free_rent = UrlParamHelper.get_bool_param('f_rnt', url_params) # フリーレント有り self.without_deposit = UrlParamHelper.get_bool_param( 'no_dp', url_params) # 敷金・礼金・保証金無し self.layout_types = UrlParamHelper.get_id_array_param( 'lay', url_params) # 間取り種別ID self.only_first_floor = UrlParamHelper.get_bool_param( '1_flr', url_params) # 1階のみ self.over_second_floor = UrlParamHelper.get_bool_param( '2_flr', url_params) # 2階以上 self.directions = UrlParamHelper.get_id_array_param( 'dir', url_params) # 開口向きID self.gas_kitchen = UrlParamHelper.get_bool_param('g_kn', url_params) # ガスキッチン self.separate = UrlParamHelper.get_bool_param('sep', url_params) # バストイレ別 self.free_internet = UrlParamHelper.get_bool_param( 'net_fr', url_params) # インターネット無料 self.indoor_washer = UrlParamHelper.get_bool_param( 'in_wsh', url_params) # 室内洗濯機設置可 self.pet = UrlParamHelper.get_bool_param('pet', url_params) # ペット可 self.instrument = UrlParamHelper.get_bool_param('inst', url_params) # 楽器 self.live_together = UrlParamHelper.get_bool_param( 'live_2', url_params) # 同居可 self.children = UrlParamHelper.get_bool_param('chld', url_params) # 子供可 self.room_share = UrlParamHelper.get_bool_param('r_shr', url_params) # ルームシェア可 self.non_japanese = UrlParamHelper.get_bool_param('no_jp', url_params) # 外国人可 self.new_student = UrlParamHelper.get_bool_param( 'new_std', url_params) # 新入生予約可 self.office_use = UrlParamHelper.get_bool_param('offc', url_params) # 事務所利用可 self.only_top_floor = UrlParamHelper.get_bool_param( 't_flr', url_params) # 最上階・上階無し self.system_kitchen = UrlParamHelper.get_bool_param( 's_kn', url_params) # システムキッチン self.washstand = UrlParamHelper.get_bool_param( 'wshstd', url_params) # 独立洗面台(シャンプードレッサー含む) self.aircon = UrlParamHelper.get_bool_param('air', url_params) # エアコン self.auto_lock = UrlParamHelper.get_bool_param('a_lck', url_params) # オートロック self.designers = UrlParamHelper.get_bool_param('dsnr', url_params) # デザイナーズ self.elevator = UrlParamHelper.get_bool_param('elv', url_params) # エレベータ self.delivery_box = UrlParamHelper.get_bool_param('dlvr', url_params) # 宅配ボックス self.reheating_bath = UrlParamHelper.get_bool_param( 'rh_bth', url_params) # 追い焚き風呂 self.washing_toilet = UrlParamHelper.get_bool_param( 'wsh_wc', url_params) # 温水洗浄便座 self.tv_intercom = UrlParamHelper.get_bool_param( 'tv_phn', url_params) # TV付インターフォン self.loft = UrlParamHelper.get_bool_param('loft', url_params) # ロフト self.renovation = UrlParamHelper.get_bool_param('reno', url_params) # リノベーション self.diy = UrlParamHelper.get_bool_param('diy', url_params) # DIY可 self.walk_in_closet = UrlParamHelper.get_bool_param( 'wic', url_params) # ウォークインクローゼット self.barrier_free = UrlParamHelper.get_bool_param('br_fr', url_params) # バリアフリー self.garbage_box_24 = UrlParamHelper.get_bool_param( 'gbg24', url_params) # 24時間ゴミ出し可 self.tenant_furnished_shop = UrlParamHelper.get_bool_param( 'tnt_fnsh', url_params) # 居抜き店舗 self.tenant_skeleton = UrlParamHelper.get_bool_param( 'tnt_skl', url_params) # スケルトン self.tenant_restaurant = UrlParamHelper.get_bool_param( 'tnt_rst', url_params) # 飲食可 self.tenant_office = UrlParamHelper.get_bool_param( 'tnt_offc', url_params) # 事務所向け self.tenant_first_floor = UrlParamHelper.get_bool_param( 'tnt_fst', url_params) # 1階店舗 self.tenant_soho = UrlParamHelper.get_bool_param( 'tnt_soho', url_params) # SOHO self.tenant_residence = UrlParamHelper.get_bool_param( 'tnt_rsdc', url_params) # 住宅付店舗 self.odr = UrlParamHelper.get_order_param('odr', url_params) # 並び順
def test_get_bool_param(self): self.assertFalse( UrlParamHelper.get_bool_param('bike', self.query_params)) self.assertTrue(UrlParamHelper.get_bool_param('grg', self.query_params))
def test_get_id_array_param(self): self.assertIsNone( UrlParamHelper.get_id_array_param('city', self.query_params)) self.assertEqual( UrlParamHelper.get_id_array_param('stn', self.query_params), (1140, 1150, 1160))
def test_get_float_param(self): self.assertIsNone( UrlParamHelper.get_float_param('south', self.query_params)) self.assertEqual( UrlParamHelper.get_float_param('north', self.query_params), float(35.011823))
def test_get_id_param(self): self.assertIsNone( UrlParamHelper.get_id_param('h_schl', self.query_params)) self.assertEqual( UrlParamHelper.get_id_param('schl', self.query_params), 1)
def test_get_int_param(self): self.assertIsNone( UrlParamHelper.get_int_param('l_rnt', self.query_params)) self.assertEqual( UrlParamHelper.get_int_param('u_rnt', self.query_params), 55000)