Skip to content
Snippets Groups Projects
Commit 8a59bf40 authored by Guillaume Valadon's avatar Guillaume Valadon Committed by Guillaume Valadon
Browse files

Test scapy._version()

parent 286d6864
No related branches found
No related tags found
No related merge requests found
...@@ -9110,3 +9110,22 @@ if test_pyx(): ...@@ -9110,3 +9110,22 @@ if test_pyx():
plist.pdfdump(filename) plist.pdfdump(filename)
assert(os.path.exists(filename)) assert(os.path.exists(filename))
os.unlink(filename) os.unlink(filename)
############
############
+ Scapy version
= _version()
import os
version_filename = os.path.join(scapy._SCAPY_PKG_DIR, "VERSION")
version = scapy._version()
assert(os.path.exists(version_filename))
import mock
with mock.patch("scapy._version_from_git_describe") as version_mocked:
version_mocked.side_effect = Exception()
assert(scapy._version() == version)
os.unlink(version_filename)
assert(scapy._version() == "git-archive.dev$Format:%h")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment