Skip to content

Commit

Permalink
Fixed: Remove obsolete style keyword (#790)
Browse files Browse the repository at this point in the history
* fix: Remove unused import and update first_round method in GoldMSI class

* chore: Remove unused keyword from Consent's first_round method

* test: Add basic unit tests for GoldMSI class
  • Loading branch information
drikusroor authored Feb 21, 2024
1 parent 46e28cf commit ea1ee64
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
1 change: 0 additions & 1 deletion backend/experiment/actions/consent.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from .frontend_style import FrontendStyle
from .base_action import BaseAction


Expand Down
8 changes: 2 additions & 6 deletions backend/experiment/rules/gold_msi.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ def __init__(self):
]
self.questions = MSI_F3_MUSICAL_TRAINING + demographics

def first_round(self, experiment):
consent = Consent(
style=FrontendStyle(
EFrontendStyle.BOOLEAN,
)
)
def first_round(self):
consent = Consent()
return [
consent,
]
Expand Down
16 changes: 16 additions & 0 deletions backend/experiment/tests/test_rules_gold_msi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from django.test import TestCase
from experiment.rules.gold_msi import GoldMSI


class TestGoldMSI(TestCase):
def test_init(self):
goldMSI = GoldMSI()
assert goldMSI.ID == 'GOLD_MSI'

def test_first_round(self):
goldMSI = GoldMSI()
result = goldMSI.first_round()

assert result[0].__class__.__name__ == 'Consent'
assert result[0].ID == 'CONSENT'

0 comments on commit ea1ee64

Please sign in to comment.