コード例 #1
0
ファイル: test_config.py プロジェクト: Arksine/moonraker
 def test_get_hash(self, config: ConfigHelper):
     opts = config.get_options()
     expected_hash = hashlib.sha256()
     for opt, val in opts.items():
         expected_hash.update(opt.encode())
         expected_hash.update(val.encode())
     cfg_hash = config.get_hash().hexdigest()
     assert cfg_hash == expected_hash.hexdigest()
コード例 #2
0
ファイル: test_config.py プロジェクト: Arksine/moonraker
 def test_get_options(self, config: ConfigHelper,
                      path_args: Dict[str, pathlib.Path]):
     expected = {
         "host": "0.0.0.0",
         "port": "7010",
         "ssl_port": "7011",
         "klippy_uds_address": str(path_args["klippy_uds_path"])
     }
     assert expected == config.get_options()