aboutsummaryrefslogtreecommitdiff
path: root/phttps___www.phoronix.com____.json
blob: 453b5012324bf275e5405db08f25bba58b047f33 (about) (plain)
1
[{"sphoronix benchmarks":{"url":"","hash":"","text":"/**\n * Copyright 2021 Wojtek Kosior\n *\n * Available under the terms of Creative Commons Zero.\n */\n\n/* Use with https://www.phoronix.com/*** */\n\n/*\n * Phoronix normally includes scripts that call document.write() to inject\n * <img> tags. The most obvious way o code a fix would then be do download and\n * parse the contents of those scripts. CORS, however, doesn't allow this.\n * Instead, we notice that the openbenchmarking embed script url is related to\n * the actual image url we need, so we can create <img>'s from it straight away.\n */\nfor (const script of document.scripts) {\n    const match = /openbenchmarking.org\\/+(embed.php\\?.*)p=0$/.exec(script.src);\n    if (!match) continue;\n\n    const img = document.createElement(\"img\");\n    img.src = `https://openbenchmarking.org/${match[1]}p=2`;\n    img.setAttribute(\"type\", \"image/svg+xml\");\n    img.setAttribute(\"width\", \"100%\");\n    img.setAttribute(\"height\", \"auto\");\n\n    script.parentElement.insertBefore(img, script);\n}\n"}},{"phttps://www.phoronix.com/***":{"components":["s","phoronix benchmarks"],"allow":false}}]
tests/test_map.py?id=771954f43c70d3ba6546fafcaec40ba59a7c1d44'>tests/test_map.py
+++ b/tests/test_map.py
@@ -93,6 +93,13 @@ class BaseMapTest:
Map = None
+ def test_init_no_args(self):
+ with self.assertRaisesRegex(TypeError, 'positional argument'):
+ self.Map(dict(a=1))
+
+ with self.assertRaisesRegex(TypeError, 'keyword argument'):
+ self.Map(a=1)
+
def test_hashkey_helper_1(self):
k1 = HashKey(10, 'aaa')
k2 = HashKey(10, 'bbb')