Skip to content

Commit

Permalink
Update dataset factories in test_models
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWags committed Oct 8, 2024
1 parent 853088c commit 6b02ec8
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions swcc/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def test_dataset_force_create_overwrite(session):
license=old_dataset.license,
description=old_dataset.description,
acknowledgement=old_dataset.acknowledgement,
file_source='./tests/test_data/project_demo.swproj',
).force_create()
new_dataset.assert_remote()

Expand All @@ -109,6 +110,7 @@ def test_dataset_force_create_no_existing(session):
license='license',
description='description',
acknowledgement='acknowledgement',
file_source='./tests/test_data/project_demo.swproj',
).force_create()
dataset.assert_remote()

Expand All @@ -130,6 +132,7 @@ def test_dataset_force_create_backup(session, version):
license=old_dataset.license,
description=old_dataset.description,
acknowledgement=old_dataset.acknowledgement,
file_source='./tests/test_data/project_demo.swproj',
).force_create(backup=True)
new_dataset.assert_remote()

Expand All @@ -150,6 +153,7 @@ def test_dataset_force_create_backup_no_version_suffix(session):
license=old_dataset.license,
description=old_dataset.description,
acknowledgement=old_dataset.acknowledgement,
file_source='./tests/test_data/project_demo.swproj',
).force_create(backup=True)
new_dataset.assert_remote()

Expand All @@ -161,16 +165,26 @@ def test_dataset_force_create_backup_no_version_suffix(session):

def test_dataset_force_create_backup_multiple_conflicts(session):
old_dataset = factories.DatasetFactory(name='dataset').create()
factories.DatasetFactory(name='dataset-v1').create()
factories.DatasetFactory(name='dataset-v2').create()
factories.DatasetFactory(name='dataset-v3').create()
factories.DatasetFactory(
name='dataset-v1',
file_source='./tests/test_data/project_demo.swproj'
).create()
factories.DatasetFactory(
name='dataset-v2',
file_source='./tests/test_data/project_demo.swproj'
).create()
factories.DatasetFactory(
name='dataset-v3',
file_source='./tests/test_data/project_demo.swproj'
).create()
assert models.Dataset.from_id(old_dataset.id)

new_dataset = models.Dataset(
name='dataset',
license=old_dataset.license,
description=old_dataset.description,
acknowledgement=old_dataset.acknowledgement,
file_source='./tests/test_data/project_demo.swproj',
).force_create(backup=True)
new_dataset.assert_remote()

Expand Down

0 comments on commit 6b02ec8

Please sign in to comment.