aboutsummaryrefslogtreecommitdiff
path: root/src/cli/test_anastasis_reducer_select_country.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/test_anastasis_reducer_select_country.sh')
-rwxr-xr-xsrc/cli/test_anastasis_reducer_select_country.sh18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/cli/test_anastasis_reducer_select_country.sh b/src/cli/test_anastasis_reducer_select_country.sh
index c02f61f..2e18f44 100755
--- a/src/cli/test_anastasis_reducer_select_country.sh
+++ b/src/cli/test_anastasis_reducer_select_country.sh
@@ -63,12 +63,11 @@ jq -e .countries[0] < $TFILE > /dev/null || exit_fail "Expected new state to inc
63jq -e .countries[0].code < $TFILE > /dev/null || exit_fail "Expected new state to include countries with code" 63jq -e .countries[0].code < $TFILE > /dev/null || exit_fail "Expected new state to include countries with code"
64jq -e .countries[0].continent < $TFILE > /dev/null || exit_fail "Expected new state to include countries with continent" 64jq -e .countries[0].continent < $TFILE > /dev/null || exit_fail "Expected new state to include countries with continent"
65jq -e .countries[0].name < $TFILE > /dev/null || exit_fail "Expected new state to include countries with name" 65jq -e .countries[0].name < $TFILE > /dev/null || exit_fail "Expected new state to include countries with name"
66jq -e .countries[0].currency < $TFILE > /dev/null || exit_fail "Expected new state to include countries with currency"
67 66
68SELECTED_CONTINENT=`jq -r -e .selected_continent < $TFILE` 67SELECTED_CONTINENT=`jq -r -e .selected_continent < $TFILE`
69if test "$SELECTED_CONTINENT" != "Europe" 68if test "$SELECTED_CONTINENT" != "Europe"
70then 69then
71 exit_fail "Expected selected continent to be 'Testcontinent', got $SELECTED_CONTINENT" 70 exit_fail "Expected selected continent to be 'Europe', got $SELECTED_CONTINENT"
72fi 71fi
73 72
74echo " OK" 73echo " OK"
@@ -84,8 +83,7 @@ echo " OK"
84echo -n "Test NX country selection ..." 83echo -n "Test NX country selection ..."
85 84
86anastasis-reducer -a \ 85anastasis-reducer -a \
87 '{"country_code": "zz", 86 '{"country_code": "zz"}' \
88 "currencies": ["EUR" ]}' \
89 select_country \ 87 select_country \
90 resources/01-backup.json $TFILE 2> /dev/null \ 88 resources/01-backup.json $TFILE 2> /dev/null \
91 && exit_fail "Expected selection to fail. Check '$TFILE'" 89 && exit_fail "Expected selection to fail. Check '$TFILE'"
@@ -95,8 +93,7 @@ echo " OK"
95echo -n "Test invalid country selection for continent ..." 93echo -n "Test invalid country selection for continent ..."
96 94
97anastasis-reducer -a \ 95anastasis-reducer -a \
98 '{"country_code": "de", 96 '{"country_code": "de"}' \
99 "currencies":["EUR"]}' \
100 select_country \ 97 select_country \
101 resources/01-backup.json $TFILE 2> /dev/null \ 98 resources/01-backup.json $TFILE 2> /dev/null \
102 && exit_fail "Expected selection to fail. Check '$TFILE'" 99 && exit_fail "Expected selection to fail. Check '$TFILE'"
@@ -106,8 +103,7 @@ echo " OK"
106echo -n "Test country selection ..." 103echo -n "Test country selection ..."
107 104
108anastasis-reducer -a \ 105anastasis-reducer -a \
109 '{"country_code": "xx", 106 '{"country_code": "xx"}' \
110 "currencies":["TESTKUDOS"]}' \
111 select_country resources/01-backup.json $TFILE 107 select_country resources/01-backup.json $TFILE
112 108
113STATE=`jq -r -e .backup_state < $TFILE` 109STATE=`jq -r -e .backup_state < $TFILE`
@@ -122,12 +118,6 @@ then
122 exit_fail "Expected selected country to be 'xx', got '$SELECTED_COUNTRY'" 118 exit_fail "Expected selected country to be 'xx', got '$SELECTED_COUNTRY'"
123fi 119fi
124echo -n "." 120echo -n "."
125SELECTED_CURRENCY=`jq -r -e .currencies[0] < $TFILE`
126if test "$SELECTED_CURRENCY" != "TESTKUDOS"
127then
128 exit_fail "Expected selected currency to be 'TESTKUDOS', got '$SELECTED_CURRENCY'"
129fi
130echo -n "."
131REQ_ATTRIBUTES=`jq -r -e .required_attributes < $TFILE` 121REQ_ATTRIBUTES=`jq -r -e .required_attributes < $TFILE`
132if test "$REQ_ATTRIBUTES" == NULL 122if test "$REQ_ATTRIBUTES" == NULL
133then 123then