diff --git a/cli_meter/test/test_helper/common.bash b/cli_meter/test/test_helper/common.bash index dd5c059..b0eef12 100644 --- a/cli_meter/test/test_helper/common.bash +++ b/cli_meter/test/test_helper/common.bash @@ -18,7 +18,8 @@ _common_setup() { EVENT_ID="1234" METER_IP="123.123.123" DATA_TYPE="events" - ZIP_FILENAME="$LOCATION-$METER_TYPE-$METER_ID-YYYYMM-$EVENT_ID.zip" + SYMLINK_NAME="$LOCATION-$METER_TYPE-$METER_ID-YYYYMM-$EVENT_ID" + ZIP_FILENAME="${SYMLINK_NAME}.zip" } _common_teardown() { diff --git a/cli_meter/test/test_scripts.bats b/cli_meter/test/test_scripts.bats index c326928..8dd6d00 100755 --- a/cli_meter/test/test_scripts.bats +++ b/cli_meter/test/test_scripts.bats @@ -45,9 +45,9 @@ teardown() { @test "zip_event.sh execution test" { mkdir -p "$TMP_DIR/$EVENT_ID" - run ./zip_event.sh "$TMP_DIR" "$TMP_DIR" "$EVENT_ID" "$ZIP_FILENAME" + run ./zip_event.sh "$TMP_DIR" "$TMP_DIR" "$EVENT_ID" "$SYMLINK_NAME" assert_success - assert_output --partial "Zipped files for event: $EVENT_ID" + assert_output --partial "Successfully zipped symlink: $SYMLINK_NAME to $TMP_DIR/$ZIP_FILENAME for event: $EVENT_ID" assert [ -f "$TMP_DIR/$ZIP_FILENAME" ] assert [ -d "$TMP_DIR/$EVENT_ID" ] } @@ -55,10 +55,10 @@ teardown() { @test "zip_event.sh test 0 arguments" { run ./zip_event.sh assert_failure $(($STREAMS_INVALID_ARGS % 256)) - assert_output --partial "Usage: zip_event.sh " + assert_output --partial "Usage: zip_event.sh " } @test "zip_event.sh test invalid event_id" { - run ./zip_event.sh "$TMP_DIR" "$TMP_DIR" "not_a_directory" "$ZIP_FILENAME" + run ./zip_event.sh "$TMP_DIR" "$TMP_DIR" "not_a_directory" "$SYMLINK_NAME" assert_failure $(($STREAMS_DIR_NOT_FOUND % 256)) } \ No newline at end of file