Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug file upload testing issue in order to avoid hitting the live platform #6

Open
zstumgoren opened this issue May 30, 2021 · 0 comments
Labels
bug Something isn't working tests

Comments

@zstumgoren
Copy link
Member

Using @pytest.mark.vcr() to record web interactions for testing produces the below error related to creating file upload URIs. We've sidestepped by marking such tests as a "webtest" and allowing them to hit the live platform, but it's worth investigating more deeply for a potential fix that avoids hitting the live platform.

    def test_project_upload_files():
        # NOTE: This is a live webtest to sidestep headaches
        # related to handling errors raised during the process
        # of generating file upload URIs (KeyError: 'createFileUploadUri')
        kwargs = {
            'is_open': False ,
            'description': 'This is a test project.'
        }
        uuid = '<FAKE_UUID>'
        project = Project.get(uuid, TOKEN)
        to_upload = [
            fixture_path('test.csv'),
            fixture_path('test2.csv')
        ]
        project.upload_files(to_upload)
        expected = ['test.csv', 'test2.csv']
        actual = [f.name for f in project.files]
>       assert project.files == expected

@zstumgoren zstumgoren added bug Something isn't working tests labels May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tests
Projects
None yet
Development

No branches or pull requests

1 participant