Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_get_tshark_version(mock_check_output):
mock_check_output.return_value = (
b'TShark 1.12.1 (Git Rev Unknown from unknown)\n\n'b'Copyright '
b'1998-2014 Gerald Combs and contributors.\n'
)
actual = get_tshark_version()
expected = '1.12.1'
assert actual == expected
def _get_tshark_version(self):
if self.__tshark_version is None:
self.__tshark_version = get_tshark_version(self.tshark_path)
return self.__tshark_version