diff options
author | sepro <sepro@sepr0.com> | 2025-03-21 21:58:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-21 20:58:10 +0000 |
commit | 9b868518a15599f3d7ef5a1c730dda164c30da9b (patch) | |
tree | 468831c44bc9408f467d0417e9125d91a2f0c22a /test/test_jsinterp.py | |
parent | 2ee3a0aff9be2be3bea60640d3d8a0febaf0acb6 (diff) |
[ie/youtube] Fix nsig and signature extraction for player `643afba4` (#12684)
Closes #12677, Closes #12682
Authored by: seproDev, bashonly
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
Diffstat (limited to 'test/test_jsinterp.py')
-rw-r--r-- | test/test_jsinterp.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py index ed3ca61c4..055dcf42f 100644 --- a/test/test_jsinterp.py +++ b/test/test_jsinterp.py @@ -462,6 +462,16 @@ class TestJSInterpreter(unittest.TestCase): ]: assert js_number_to_string(test, radix) == expected + def test_extract_function(self): + jsi = JSInterpreter('function a(b) { return b + 1; }') + func = jsi.extract_function('a') + self.assertEqual(func([2]), 3) + + def test_extract_function_with_global_stack(self): + jsi = JSInterpreter('function c(d) { return d + e + f + g; }') + func = jsi.extract_function('c', {'e': 10}, {'f': 100, 'g': 1000}) + self.assertEqual(func([1]), 1111) + if __name__ == '__main__': unittest.main() |