Skip to content

Commit

Permalink
type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrOertlin committed Apr 10, 2024
1 parent 65f38fe commit 415beb9
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/database/crud/test_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_get_analysis_by_id(base_store: Store, test_analysis: Analysis):
# GIVEN an analysis and a store with the analysis

# WHEN getting the analysis by id
analysis = base_store.get_analysis_by_id(analysis_id=test_analysis.id)
analysis: Analysis = base_store.get_analysis_by_id(analysis_id=test_analysis.id)

# THEN the analysis is returned
assert analysis.id == test_analysis.id
Expand All @@ -46,7 +46,7 @@ def test_get_analyses(base_store: Store, test_analyses: list[Analysis]):
# GIVEN an analysis and a store with the analysis

# WHEN getting the analyses
analyses = base_store.get_analyses()
analyses: list[Analysis] = base_store.get_analyses()

# THEN the analyses are returned
assert analyses == test_analyses
Expand All @@ -56,7 +56,7 @@ def test_get_analyses_with_skip_and_limit(base_store: Store, test_analyses: list
# GIVEN an analysis and a store with the analysis

# WHEN getting the analyses with skip and limit
analyses = base_store.get_analyses_with_skip_and_limit(skip=0, limit=2)
analyses: list[Analysis] = base_store.get_analyses_with_skip_and_limit(skip=0, limit=2)

# THEN the analyses are returned
assert analyses == test_analyses[:2]
Expand Down Expand Up @@ -90,7 +90,7 @@ def test_get_plate_by_id(base_store: Store, test_plate: Plate):
# GIVEN a plate and a store with the plate

# WHEN getting the plate by id
plate = base_store.get_plate_by_id(plate_id=test_plate.id)
plate: Plate = base_store.get_plate_by_id(plate_id=test_plate.id)

# THEN the plate is returned
assert plate.id == test_plate.id
Expand All @@ -100,7 +100,7 @@ def test_get_plate_by_plate_id(base_store: Store, test_plate: Plate):
# GIVEN a plate and a store with the plate

# WHEN getting the plate by plate id
plate = base_store.get_plate_by_plate_id(plate_id=test_plate.plate_id)
plate: Plate = base_store.get_plate_by_plate_id(plate_id=test_plate.plate_id)

# THEN the plate is returned
assert plate.plate_id == test_plate.plate_id
Expand All @@ -110,7 +110,7 @@ def get_user_by_id(base_store: Store, test_user: User):
# GIVEN a user and a store with the user

# WHEN getting the user by id
user = base_store.get_user_by_id(user_id=test_user.id)
user: User = base_store.get_user_by_id(user_id=test_user.id)

# THEN the user is returned
assert user.id == test_user.id
Expand All @@ -120,7 +120,7 @@ def get_user_by_email(base_store: Store, test_user: User):
# GIVEN a user and a store with the user

# WHEN getting the user by email
user = base_store.get_user_by_email(email=test_user.email)
user: User = base_store.get_user_by_email(email=test_user.email)

# THEN the user is returned
assert user.email == test_user.email
Expand All @@ -130,17 +130,17 @@ def get_user_with_skip_and_limit(base_store: Store, test_user: User):
# GIVEN a user and a store with the user

# WHEN getting the user with skip and limit
user = base_store.get_users_with_skip_and_limit(skip=0, limit=2)
user: User = base_store.get_users_with_skip_and_limit(skip=0, limit=2)

# THEN the user is returned
assert user == test_user[:2]
assert user == test_user


def test_get_genotype_by_id(base_store: Store, test_genotype: Genotype):
# GIVEN a genotype and a store with the genotype

# WHEN getting the genotype by id
genotype = base_store.get_genotype_by_id(entry_id=test_genotype.id)
genotype: Genotype = base_store.get_genotype_by_id(entry_id=test_genotype.id)

# THEN the genotype is returned
assert genotype.id == test_genotype.id
Expand All @@ -150,7 +150,7 @@ def test_get_snps(base_store: Store, test_snps: list[SNP]):
# GIVEN a SNP and a store with the SNP

# WHEN getting the SNPs
snps = base_store.get_snps()
snps: list[SNP] = base_store.get_snps()

# THEN the SNPs are returned
assert len(snps) == len(test_snps)
Expand All @@ -160,7 +160,7 @@ def test_get_snps_by_limit_and_skip(base_store: Store, test_snps: list[SNP]):
# GIVEN a SNP and a store with the SNP

# WHEN getting the SNPs
snps = base_store.get_snps_by_limit_and_skip(skip=0, limit=2)
snps: list[SNP] = base_store.get_snps_by_limit_and_skip(skip=0, limit=2)

# THEN the SNPs are returned
assert len(snps) == len(test_snps)
Expand All @@ -175,6 +175,6 @@ def test_get_ordered_plates(base_store: Store, test_plates: list[Plate], helpers
helpers.ensure_plate(store=base_store, plate=out_of_limit_plate)
# WHEN getting the ordered plates

plates = base_store.get_ordered_plates(order_params=plate_order_params)
plates: list[Plate] = base_store.get_ordered_plates(order_params=plate_order_params)
# THEN the plates are returned
assert len(plates) == len(test_plates)

0 comments on commit 415beb9

Please sign in to comment.