pyDataverse icon indicating copy to clipboard operation
pyDataverse copied to clipboard

Implement test strategy for API tests

Open skasberger opened this issue 4 years ago • 1 comments

Prepare

  • [x] Risk Assessment #82
  • [ ] Test Strategy #70
  • [ ] Work out testdata #84
  • [ ] Read Dataverse API docs
  • [ ] Check out ǹotes_api.md

Steps

  • [x] Get test base directory as variable
  • [ ] create query strings by hand, as in helper functions.
  • [ ] Passing empty string as base_url should create an error
  • [ ] token = None oder empty sollte auch einen error werfen
  • [ ] Use @pytest.mark.skipif() when os.getenv(TRAVIS) == True
  • [ ] Run tests
  • [ ] Update test strategy
    • [ ] Docs
    • [ ] Endpoint availability
  • [ ] Define Tests
    • [ ] Prioritize behavior to be tested and define tests for it
      • [ ] Define test data for each test: input data, expected
    • [ ] Define fixtures
  • [ ] Check: private information in VCR cassettes: API Token,
  • [ ] Remove old JSON test data files
  • [ ] Update Test Strategy #70
  • [ ] pytest pandas geht. pytest pyDataverse machen!

Write fixtures

  • [ ] Fixtures
    • [ ] Docs
    • [ ] define scope for each fixture, if not default.
    • [ ] for all input data

Fixtures:

  • native_api
  • dataaccess_api
  • metrics_api
  • search_api
  • get_info_version
    • setup
      • native_api
  • Create Dataverse
    • Scope
    • setup
      • create_dataverse()
    • teardown
      • delete_dataverse()
  • Create Dataset min
    • Scope
    • setup
      • create_dataset()
    • teardown
      • delete_dataset()
  • Publish Dataset
    • Scope
    • setup
      • Create Dataset
      • publish_dataset()
    • teardown
      • destroy_dataset()
  • Upload Datafile
    • Scope
    • setup
      • upload_datafile()
    • teardown
      • delete_datafile()

Write tests

  • check out notes_api.md
  • different test-cases

Review

  • [ ] Risk Assessment
    • [ ] Content
    • [ ] Documentation

Follow Ups

  • [ ] Review Test Strategy #70
  • [ ] Review test data:
    • [ ] data
    • [ ] docs
  • [ ] Review Risk Assessment
  • [ ] Re-factor API tests
    • [ ] add new tests

skasberger avatar Feb 12 '21 16:02 skasberger

As discussed during the 2024-02-14 meeting of the pyDataverse working group, we are closing old milestones in favor of a new project board at https://github.com/orgs/gdcc/projects/1 and removing issues (like this one) from those old milestones. Please feel free to join the working group! You can find us at https://py.gdcc.io and https://dataverse.zulipchat.com/#narrow/stream/377090-python

pdurbin avatar Feb 14 '24 19:02 pdurbin