コード例 #1
0
    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)
コード例 #2
0
 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)
コード例 #3
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)