Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 409976052
  • Loading branch information
starmandeluxe committed Nov 15, 2021
1 parent 50a259f commit 99a28b2
Showing 1 changed file with 41 additions and 113 deletions.
154 changes: 41 additions & 113 deletions shoptimizer_api/optimizers_builtin/condition_optimizer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ def setUp(self) -> None:
}, {
'testcase_name': 'used 3',
'test_title': '【Used】 新しい商品だよ?'
}, {
'testcase_name': 'outlet',
'test_title': 'アウトレット セール 新しい商品だよ?'
}, {
'testcase_name': 'separate',
'test_title': 'ばらした商品 新しい商品だよ?'
}, {
'testcase_name': 'unused',
'test_title': '未使用 新しい商品だよ?'
Expand All @@ -66,30 +60,15 @@ def setUp(self) -> None:
}, {
'testcase_name': 'like new',
'test_title': '新品同様 新しい商品だよ?'
}, {
'testcase_name': 'dirty 1',
'test_title': '汚れあり 新しい商品だよ?'
}, {
'testcase_name': 'dirty 2',
'test_title': '汚かったり 新しい商品だよ?'
}, {
'testcase_name': 'unopened',
'test_title': '未開封 新しい商品だよ?'
}, {
'testcase_name': 'no box',
'test_title': '箱なし 新しい商品だよ?'
}, {
'testcase_name': 'beautiful condition',
'test_title': '美品 新しい商品だよ?'
}, {
'testcase_name': 'some reason',
'test_title': '【訳あり】 新しい商品だよ?'
}, {
'testcase_name': 'not wrapped',
'test_title': '未梱包 新しい商品だよ?'
}, {
'testcase_name': 'unsold',
'test_title': '非売品 新しい商品だよ?'
}])
def test_condition_optimizer_sets_new_product_to_used_based_on_title(
self, test_title):
Expand All @@ -112,12 +91,6 @@ def test_condition_optimizer_sets_new_product_to_used_based_on_title(
}, {
'testcase_name': 'used 3',
'test_description': '【Used】 新しい商品だよ?'
}, {
'testcase_name': 'outlet',
'test_description': 'アウトレット セール 新しい商品だよ?'
}, {
'testcase_name': 'separate',
'test_description': 'ばらした商品 新しい商品だよ?'
}, {
'testcase_name': 'unused',
'test_description': '未使用 新しい商品だよ?'
Expand All @@ -133,30 +106,15 @@ def test_condition_optimizer_sets_new_product_to_used_based_on_title(
}, {
'testcase_name': 'like new',
'test_description': '新品同様 新しい商品だよ?'
}, {
'testcase_name': 'dirty 1',
'test_description': '汚れあり 新しい商品だよ?'
}, {
'testcase_name': 'dirty 2',
'test_description': '汚かったり 新しい商品だよ?'
}, {
'testcase_name': 'unopened',
'test_description': '未開封 新しい商品だよ?'
}, {
'testcase_name': 'no box',
'test_description': '箱なし 新しい商品だよ?'
}, {
'testcase_name': 'beautiful condition',
'test_description': '美品 新しい商品だよ?'
}, {
'testcase_name': 'some reason',
'test_description': '【訳あり】 新しい商品だよ?'
}, {
'testcase_name': 'not wrapped',
'test_description': '未梱包 新しい商品だよ?'
}, {
'testcase_name': 'unsold',
'test_description': '非売品 新しい商品だよ?'
}])
def test_condition_optimizer_sets_new_product_to_used_based_on_description(
self, test_description):
Expand All @@ -171,21 +129,15 @@ def test_condition_optimizer_sets_new_product_to_used_based_on_description(
self.assertEqual(1, optimization_result.num_of_products_optimized)

@parameterized.named_parameters([{
'testcase_name':
'trading cards',
'test_category':
'芸術・エンターテイメント > 趣味・コレクション '
'> コレクションアイテム > トレーディングカード',
'test_title':
'カード名: 新しい商品だよ?'
}, {
'testcase_name':
'smartphones',
'test_category':
'電気製品 > 通信機器 > 電話 > '
'携帯電話・スマートフォン',
'test_title':
'ロック解除済: 新しい商品だよ?'
'testcase_name': 'trading cards',
'test_category': '芸術・エンターテイメント > 趣味・コレクション '
'> コレクションアイテム > トレーディングカード',
'test_title': 'カード名: 新しい商品だよ?'
}, {
'testcase_name': 'smartphones',
'test_category': '電気製品 > 通信機器 > 電話 > '
'携帯電話・スマートフォン',
'test_title': 'ロック解除済: 新しい商品だよ?'
}])
def test_condition_optimizer_sets_new_to_used_based_on_category_and_title(
self, test_category, test_title):
Expand All @@ -203,19 +155,13 @@ def test_condition_optimizer_sets_new_to_used_based_on_category_and_title(
self.assertEqual(1, optimization_result.num_of_products_optimized)

@parameterized.named_parameters([{
'testcase_name':
'trading cards',
'test_category':
6997,
'test_title':
'カード名: 新しい商品だよ?'
}, {
'testcase_name':
'smartphones',
'test_category':
267,
'test_title':
'ロック解除済: 新しい商品だよ?'
'testcase_name': 'trading cards',
'test_category': 6997,
'test_title': 'カード名: 新しい商品だよ?'
}, {
'testcase_name': 'smartphones',
'test_category': 267,
'test_title': 'ロック解除済: 新しい商品だよ?'
}])
def test_condition_optimizer_sets_new_to_used_based_on_gpc_id_and_title(
self, test_category, test_title):
Expand All @@ -233,21 +179,15 @@ def test_condition_optimizer_sets_new_to_used_based_on_gpc_id_and_title(
self.assertEqual(1, optimization_result.num_of_products_optimized)

@parameterized.named_parameters([{
'testcase_name':
'trading cards',
'test_category':
'芸術・エンターテイメント > 趣味・コレクション '
'> コレクションアイテム > トレーディングカード',
'test_description':
'カード名: 新しい商品だよ?'
}, {
'testcase_name':
'smartphones',
'test_category':
'電気製品 > 通信機器 > 電話 > '
'携帯電話・スマートフォン',
'test_description':
'ロック解除済: 新しい商品だよ?'
'testcase_name': 'trading cards',
'test_category': '芸術・エンターテイメント > 趣味・コレクション '
'> コレクションアイテム > トレーディングカード',
'test_description': 'カード名: 新しい商品だよ?'
}, {
'testcase_name': 'smartphones',
'test_category': '電気製品 > 通信機器 > 電話 > '
'携帯電話・スマートフォン',
'test_description': 'ロック解除済: 新しい商品だよ?'
}])
def test_condition_optimizer_sets_new_to_used_based_on_category_and_description(
self, test_category, test_description):
Expand Down Expand Up @@ -369,21 +309,15 @@ def test_condition_optimizer_doesnt_change_condition_based_no_matches_in_descrip
self.assertEqual(0, optimization_result.num_of_products_optimized)

@parameterized.named_parameters([{
'testcase_name':
'trading cards',
'test_category':
'芸術・エンターテイメント > 趣味・コレクション '
'> コレクションアイテム > トレーディングカード',
'test_title':
'カード: 新しい商品だよ?'
}, {
'testcase_name':
'smartphones',
'test_category':
'電気製品 > 通信機器 > 電話 > '
'携帯電話・スマートフォン',
'test_title':
'ロック: 新しい商品だよ?'
'testcase_name': 'trading cards',
'test_category': '芸術・エンターテイメント > 趣味・コレクション '
'> コレクションアイテム > トレーディングカード',
'test_title': 'カード: 新しい商品だよ?'
}, {
'testcase_name': 'smartphones',
'test_category': '電気製品 > 通信機器 > 電話 > '
'携帯電話・スマートフォン',
'test_title': 'ロック: 新しい商品だよ?'
}])
def test_condition_optimizer_doesnt_change_condition_based_on_category_and_no_matches_in_title(
self, test_category, test_title):
Expand All @@ -401,19 +335,13 @@ def test_condition_optimizer_doesnt_change_condition_based_on_category_and_no_ma
self.assertEqual(0, optimization_result.num_of_products_optimized)

@parameterized.named_parameters([{
'testcase_name':
'trading cards',
'test_category':
'芸術・エンターテイメント > 趣味・コレクション > コレクションアイテム > トレーディングカード',
'test_description':
'カード: 新しい商品だよ?'
}, {
'testcase_name':
'smartphones',
'test_category':
'電気製品 > 通信機器 > 電話 > 携帯電話・スマートフォン',
'test_description':
'ロック: 新しい商品だよ?'
'testcase_name': 'trading cards',
'test_category': '芸術・エンターテイメント > 趣味・コレクション > コレクションアイテム > トレーディングカード',
'test_description': 'カード: 新しい商品だよ?'
}, {
'testcase_name': 'smartphones',
'test_category': '電気製品 > 通信機器 > 電話 > 携帯電話・スマートフォン',
'test_description': 'ロック: 新しい商品だよ?'
}])
def test_condition_optimizer_doesnt_change_condition_based_on_category_and_no_matches_in_description(
self, test_category, test_description):
Expand Down

0 comments on commit 99a28b2

Please sign in to comment.