Files
dataset-uploader/features/google_sheets_tracker/update_status_real_api.feature

70 lines
2.8 KiB
Gherkin

@real_api
Feature: Update Status Real API Implementation
As a developer
I want update_status to work correctly with real API calls
So that all code paths are exercised
Note: These tests use real Google Sheets API calls (not mocked)
Background:
Given an authenticated sheets tracker
Scenario: Update status with only status column present (no error column)
Given a real spreadsheet with headers "Dataset Name, Status"
And a sheet with the following datasets
| Dataset Name | Status |
| wordnet | NOT STARTED |
When I update "wordnet" status to "IN PROGRESS" with real API call
Then the update should succeed
And only the status column should be updated
Scenario: Update error with only error column present (no status column)
Given a real spreadsheet with headers "Dataset Name, Error"
And a sheet with the following datasets
| Dataset Name | Error |
| wordnet | |
When I update "wordnet" with error "Test error" using real API call
Then the update should succeed
And only the error column should be updated
Scenario: Update status and error when both columns present
Given a sheet with the following datasets
| Dataset Name | Status | Error |
| wordnet | NOT STARTED | |
When I update "wordnet" status to "IN PROGRESS" with error_msg "Processing" using real API call
Then the update should succeed
And both status and error columns should be updated
Scenario: Clear error message by passing None
Given a sheet with the following datasets
| Dataset Name | Status | Error |
| wordnet | IN PROGRESS | Previous error |
When I update "wordnet" status to "DONE" with error_message=None using real API call
Then the update should succeed
And the error column should be cleared to empty string
Scenario: Clear error message by passing empty string
Given a sheet with the following datasets
| Dataset Name | Status | Error |
| wordnet | IN PROGRESS | Previous error |
When I update "wordnet" status to "DONE" with empty error using real API call
Then the update should succeed
And the error column should be cleared
Scenario: Update returns False when updates list is empty
Given a real spreadsheet with headers "Dataset Name"
And a sheet with the following datasets
| Dataset Name |
| wordnet |
When I attempt to update "wordnet" using real API call
Then the update should return False
And no API call should be made
Scenario: Update with dataset in row 10
Given a real spreadsheet with 9 datasets before "wordnet"
When I update "wordnet" status using real API call
Then the API should use row number 11 in cell ranges