def test_happy(self) -> None: """Tests the happy path.""" with config.ConfigContext("workdir", "/path/to/workdir"): actual = config.Config.get_workdir() expected = "/path/to/workdir" self.assertEqual(actual, expected)
def test_happy(self) -> None: """Tests the happy path.""" with config.ConfigContext("timezone", "Europe/Budapest"): local_dt = datetime.datetime.fromtimestamp(0) ui_dt = webframe.local_to_ui_tz(local_dt) if time.strftime('%Z%z') == "CET+0100": self.assertEqual(ui_dt.timestamp(), 0)
def test_custom_locale(self) -> None: """Tests the main page with a custom locale.""" with config.ConfigContext("locale", "en_US.UTF-8"): root = self.get_dom_for_path("") results = root.findall("body/table") self.assertEqual(len(results), 1)