Add replace in assert policy and fix policy

Signed-off-by: Dmitriy Zayakin <d.zayakin@yadro.com>
This commit is contained in:
Dmitriy Zayakin 2023-08-17 11:54:13 +03:00
parent e70532d6e0
commit da31a82126

View file

@ -246,7 +246,7 @@ class TestNodeManagement(ClusterTestBase):
{3}, {3},
), ),
( (
"REP 1 CBF 1 SELECT 1 FROM LOC_SPB FILTER 'UN-LOCODE' EQ 'RU LED' AS LOC_SPB", "REP 1 IN SEL_SPB CBF 1 SELECT 1 FROM LOC_SPB AS SEL_SPB FILTER 'UN-LOCODE' EQ 'RU LED' AS LOC_SPB",
1, 1,
{2}, {2},
), ),
@ -263,23 +263,23 @@ class TestNodeManagement(ClusterTestBase):
{1, 2, 3, 4}, {1, 2, 3, 4},
), ),
( (
"REP 1 CBF 1 SELECT 1 FROM LOC_SPB " "REP 1 IN SEL_SPB CBF 1 SELECT 1 FROM LOC_SPB AS SEL_SPB "
"FILTER 'UN-LOCODE' NE 'RU MOW' AND 'UN-LOCODE' NE 'SE STO' AND 'UN-LOCODE' NE 'FI HEL' AS LOC_SPB", "FILTER 'UN-LOCODE' NE 'RU MOW' AND 'UN-LOCODE' NE 'SE STO' AND 'UN-LOCODE' NE 'FI HEL' AS LOC_SPB",
1, 1,
{2}, {2},
), ),
( (
"REP 2 CBF 1 SELECT 2 FROM LOC_RU FILTER SubDivCode NE 'AB' AND SubDivCode NE '18' AS LOC_RU", "REP 2 IN SEL CBF 1 SELECT 2 FROM LOC_RU AS SEL FILTER SubDivCode NE 'AB' AND SubDivCode NE '18' AS LOC_RU",
2, 2,
{1, 2}, {1, 2},
), ),
( (
"REP 2 CBF 1 SELECT 2 FROM LOC_RU FILTER Country EQ 'Russia' AS LOC_RU", "REP 2 IN SEL_EU CBF 1 SELECT 2 FROM LOC_RU AS SEL_EU FILTER Country EQ 'Russia' AS LOC_RU",
2, 2,
{1, 2}, {1, 2},
), ),
( (
"REP 2 CBF 1 SELECT 2 FROM LOC_EU FILTER Country NE 'Russia' AS LOC_EU", "REP 2 IN SEL_EU CBF 1 SELECT 2 FROM LOC_EU AS SEL_EU FILTER Country NE 'Russia' AS LOC_EU",
2, 2,
{3, 4}, {3, 4},
), ),
@ -462,7 +462,7 @@ class TestNodeManagement(ClusterTestBase):
got_policy = placement_policy_from_container( got_policy = placement_policy_from_container(
get_container(wallet, cid, json_mode=False, shell=self.shell, endpoint=endpoint) get_container(wallet, cid, json_mode=False, shell=self.shell, endpoint=endpoint)
) )
assert got_policy == placement_rule.replace( assert got_policy.replace("'", "") == placement_rule.replace(
"'", "" "'", ""
), f"Expected \n{placement_rule} and got policy \n{got_policy} are the same" ), f"Expected \n{placement_rule} and got policy \n{got_policy} are the same"
oid = put_object_to_random_node( oid = put_object_to_random_node(