Fix analysis tests

pull/906/head
Nikhil Parasaram 6 years ago
parent cb9baaead7
commit d3e200bb22
  1. 16
      tests/mythril/analyzer_test.py
  2. 24
      tests/mythril/mythril_analyzer_test.py

@ -1,16 +0,0 @@
import pytest
from pathlib import Path
from mythril.mythril import *
fire_lasers_execute = []
def fire_lasers_test():
disassembler = MythrilDisassembler(eth=None)
disassembler.load_from_solidity(
Path(__file__).parent.parent / "testdata/input_contracts/origin.sol"
)
analyzer = MythrilAnalyzer(disassembler)
issues = analyzer.fire_lasers(strategy="dfs").sorted_issues()
assert len(issues) == 1
assert issues["swc-id"] == "111"

@ -0,0 +1,24 @@
import pytest
from pathlib import Path
from mythril.mythril import *
def test_fire_lasers():
disassembler = MythrilDisassembler(eth=None)
print(str((Path(__file__).parent.parent / "testdata/input_contracts/origin.sol")))
print(Path(__file__))
disassembler.load_from_solidity(
[
str(
(
Path(__file__).parent.parent / "testdata/input_contracts/origin.sol"
).absolute()
)
]
)
analyzer = MythrilAnalyzer(disassembler)
issues = analyzer.fire_lasers(
strategy="dfs", max_depth=30, transaction_count=2, create_timeout=10, modules=[]
).sorted_issues()
assert len(issues) == 1
assert issues[0]["swc-id"] == "111"
Loading…
Cancel
Save