Coverage for /pythoncovmergedfiles/medio/medio/src/selkies/tests/fuzz/fuzz_sdp.py: 29%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

24 statements  

1###### Coverage stub 

2import atexit 

3import coverage 

4cov = coverage.coverage(data_file='.coverage', cover_pylib=True) 

5cov.start() 

6# Register an exist handler that will print coverage 

7def exit_handler(): 

8 cov.stop() 

9 cov.save() 

10atexit.register(exit_handler) 

11####### End of coverage stub 

12#!/usr/bin/env python3 

13# This Source Code Form is subject to the terms of the Mozilla Public 

14# License, v. 2.0. If a copy of the MPL was not distributed with this 

15# file, You can obtain one at https://mozilla.org/MPL/2.0/. 

16"""Fuzzes parsing of the session descriptions a peer sends over signaling.""" 

17import sys 

18 

19import atheris 

20 

21with atheris.instrument_imports(): 

22 from selkies.webrtc import sdp 

23 

24 

25def TestOneInput(data): 

26 try: 

27 sdp.SessionDescription.parse(data.decode("utf-8", "replace")) 

28 except ValueError: 

29 pass 

30 

31 

32def main(): 

33 atheris.Setup(sys.argv, TestOneInput) 

34 atheris.Fuzz() 

35 

36 

37if __name__ == "__main__": 

38 main()