Skip to content

Commit

Permalink
Tests: refactor: simplify assignment of util test fixtures (#1342)
Browse files Browse the repository at this point in the history
  • Loading branch information
jayaddison authored Nov 1, 2024
1 parent 635f1b7 commit 88b3701
Showing 1 changed file with 28 additions and 30 deletions.
58 changes: 28 additions & 30 deletions tests/library/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,34 @@


class TestUtils(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.iso8601_fixtures = {
"PT1H": 60,
"PT20M": 20,
"PT2H10M": 130,
"PT0H9M30S": 10,
}
cls.minutes_fixtures = [
("1 hour 15 mins", 75),
("1h and 15mins", 75),
("3h10m", 190),
("PT2H30M", 150),
("P0DT1H10M", 70),
("90", 90),
("1.5 hours", 90),
("2 days", 2880),
("1½ hours", 90),
("1¾ hours", 105),
("1¼ hours", 75),
("1⅔ hours", 100),
("1 1/2 hours", 90),
("1 3/4 hours", 105),
("1 1/4 hours", 75),
("1 2/3 hours", 100),
("15 - 20 minutes", 20),
("15 to 20 minutes", 20),
("Pá-Pum", None),
("PT0M", None),
]
iso8601_fixtures = {
"PT1H": 60,
"PT20M": 20,
"PT2H10M": 130,
"PT0H9M30S": 10,
}
minutes_fixtures = [
("1 hour 15 mins", 75),
("1h and 15mins", 75),
("3h10m", 190),
("PT2H30M", 150),
("P0DT1H10M", 70),
("90", 90),
("1.5 hours", 90),
("2 days", 2880),
("1½ hours", 90),
("1¾ hours", 105),
("1¼ hours", 75),
("1⅔ hours", 100),
("1 1/2 hours", 90),
("1 3/4 hours", 105),
("1 1/4 hours", 75),
("1 2/3 hours", 100),
("15 - 20 minutes", 20),
("15 to 20 minutes", 20),
("Pá-Pum", None),
("PT0M", None),
]

def test_minutes_fixtures(self):
# Tests for minute related output formats.
Expand Down

0 comments on commit 88b3701

Please sign in to comment.