diff options
Diffstat (limited to 'src/cli/test_anastasis_reducer_select_country.sh')
-rwxr-xr-x | src/cli/test_anastasis_reducer_select_country.sh | 18 |
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 | |||
63 | jq -e .countries[0].code < $TFILE > /dev/null || exit_fail "Expected new state to include countries with code" | 63 | jq -e .countries[0].code < $TFILE > /dev/null || exit_fail "Expected new state to include countries with code" |
64 | jq -e .countries[0].continent < $TFILE > /dev/null || exit_fail "Expected new state to include countries with continent" | 64 | jq -e .countries[0].continent < $TFILE > /dev/null || exit_fail "Expected new state to include countries with continent" |
65 | jq -e .countries[0].name < $TFILE > /dev/null || exit_fail "Expected new state to include countries with name" | 65 | jq -e .countries[0].name < $TFILE > /dev/null || exit_fail "Expected new state to include countries with name" |
66 | jq -e .countries[0].currency < $TFILE > /dev/null || exit_fail "Expected new state to include countries with currency" | ||
67 | 66 | ||
68 | SELECTED_CONTINENT=`jq -r -e .selected_continent < $TFILE` | 67 | SELECTED_CONTINENT=`jq -r -e .selected_continent < $TFILE` |
69 | if test "$SELECTED_CONTINENT" != "Europe" | 68 | if test "$SELECTED_CONTINENT" != "Europe" |
70 | then | 69 | then |
71 | exit_fail "Expected selected continent to be 'Testcontinent', got $SELECTED_CONTINENT" | 70 | exit_fail "Expected selected continent to be 'Europe', got $SELECTED_CONTINENT" |
72 | fi | 71 | fi |
73 | 72 | ||
74 | echo " OK" | 73 | echo " OK" |
@@ -84,8 +83,7 @@ echo " OK" | |||
84 | echo -n "Test NX country selection ..." | 83 | echo -n "Test NX country selection ..." |
85 | 84 | ||
86 | anastasis-reducer -a \ | 85 | anastasis-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" | |||
95 | echo -n "Test invalid country selection for continent ..." | 93 | echo -n "Test invalid country selection for continent ..." |
96 | 94 | ||
97 | anastasis-reducer -a \ | 95 | anastasis-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" | |||
106 | echo -n "Test country selection ..." | 103 | echo -n "Test country selection ..." |
107 | 104 | ||
108 | anastasis-reducer -a \ | 105 | anastasis-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 | ||
113 | STATE=`jq -r -e .backup_state < $TFILE` | 109 | STATE=`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'" |
123 | fi | 119 | fi |
124 | echo -n "." | 120 | echo -n "." |
125 | SELECTED_CURRENCY=`jq -r -e .currencies[0] < $TFILE` | ||
126 | if test "$SELECTED_CURRENCY" != "TESTKUDOS" | ||
127 | then | ||
128 | exit_fail "Expected selected currency to be 'TESTKUDOS', got '$SELECTED_CURRENCY'" | ||
129 | fi | ||
130 | echo -n "." | ||
131 | REQ_ATTRIBUTES=`jq -r -e .required_attributes < $TFILE` | 121 | REQ_ATTRIBUTES=`jq -r -e .required_attributes < $TFILE` |
132 | if test "$REQ_ATTRIBUTES" == NULL | 122 | if test "$REQ_ATTRIBUTES" == NULL |
133 | then | 123 | then |