Rename test/ to tests/
This commit is contained in:
parent
030497beb0
commit
57100062af
4
setup.py
4
setup.py
@ -27,7 +27,7 @@ from setuptools import setup, find_packages
|
|||||||
setup(
|
setup(
|
||||||
name = "stcgal",
|
name = "stcgal",
|
||||||
version = stcgal.__version__,
|
version = stcgal.__version__,
|
||||||
packages = find_packages(exclude=["doc", "test"]),
|
packages = find_packages(exclude=["doc", "tests"]),
|
||||||
install_requires = ["pyserial"],
|
install_requires = ["pyserial"],
|
||||||
extras_require = {
|
extras_require = {
|
||||||
"usb": ["pyusb>=1.0.0"]
|
"usb": ["pyusb>=1.0.0"]
|
||||||
@ -55,6 +55,6 @@ setup(
|
|||||||
"Topic :: Software Development :: Embedded Systems",
|
"Topic :: Software Development :: Embedded Systems",
|
||||||
"Topic :: Software Development",
|
"Topic :: Software Development",
|
||||||
],
|
],
|
||||||
test_suite = "test",
|
test_suite = "tests",
|
||||||
tests_require = ["PyYAML"],
|
tests_require = ["PyYAML"],
|
||||||
)
|
)
|
||||||
|
@ -29,7 +29,7 @@ from unittest.mock import patch
|
|||||||
import yaml
|
import yaml
|
||||||
import stcgal.frontend
|
import stcgal.frontend
|
||||||
import stcgal.protocols
|
import stcgal.protocols
|
||||||
from test.test_program import get_default_opts, convert_to_bytes
|
from tests.test_program import get_default_opts, convert_to_bytes
|
||||||
|
|
||||||
class ByteArrayFuzzer:
|
class ByteArrayFuzzer:
|
||||||
"""Fuzzer for byte arrays"""
|
"""Fuzzer for byte arrays"""
|
||||||
@ -78,13 +78,13 @@ class TestProgramFuzzed(unittest.TestCase):
|
|||||||
def test_program_fuzz(self, err, out, sleep_mock, serial_mock, write_mock, read_mock):
|
def test_program_fuzz(self, err, out, sleep_mock, serial_mock, write_mock, read_mock):
|
||||||
"""Test programming cycles with fuzzing enabled"""
|
"""Test programming cycles with fuzzing enabled"""
|
||||||
yml = [
|
yml = [
|
||||||
"./test/iap15f2k61s2.yml",
|
"./tests/iap15f2k61s2.yml",
|
||||||
"./test/stc12c2052ad.yml",
|
"./tests/stc12c2052ad.yml",
|
||||||
"./test/stc15w4k56s4.yml",
|
"./tests/stc15w4k56s4.yml",
|
||||||
"./test/stc12c5a60s2.yml",
|
"./tests/stc12c5a60s2.yml",
|
||||||
"./test/stc89c52rc.yml",
|
"./tests/stc89c52rc.yml",
|
||||||
"./test/stc15l104w.yml",
|
"./tests/stc15l104w.yml",
|
||||||
"./test/stc15f104e.yml",
|
"./tests/stc15f104e.yml",
|
||||||
]
|
]
|
||||||
fuzzer = ByteArrayFuzzer()
|
fuzzer = ByteArrayFuzzer()
|
||||||
fuzzer.cut_propability = 0.01
|
fuzzer.cut_propability = 0.01
|
@ -57,7 +57,7 @@ class ProgramTests(unittest.TestCase):
|
|||||||
@patch("sys.stdout")
|
@patch("sys.stdout")
|
||||||
def test_program_stc89(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
def test_program_stc89(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
||||||
"""Test a programming cycle with STC89 protocol"""
|
"""Test a programming cycle with STC89 protocol"""
|
||||||
self._program_yml("./test/stc89c52rc.yml", serial_mock, read_mock)
|
self._program_yml("./tests/stc89c52rc.yml", serial_mock, read_mock)
|
||||||
|
|
||||||
@patch("stcgal.protocols.StcBaseProtocol.read_packet")
|
@patch("stcgal.protocols.StcBaseProtocol.read_packet")
|
||||||
@patch("stcgal.protocols.Stc89Protocol.write_packet")
|
@patch("stcgal.protocols.Stc89Protocol.write_packet")
|
||||||
@ -66,7 +66,7 @@ class ProgramTests(unittest.TestCase):
|
|||||||
@patch("sys.stdout")
|
@patch("sys.stdout")
|
||||||
def test_program_stc12(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
def test_program_stc12(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
||||||
"""Test a programming cycle with STC12 protocol"""
|
"""Test a programming cycle with STC12 protocol"""
|
||||||
self._program_yml("./test/stc12c5a60s2.yml", serial_mock, read_mock)
|
self._program_yml("./tests/stc12c5a60s2.yml", serial_mock, read_mock)
|
||||||
|
|
||||||
@patch("stcgal.protocols.StcBaseProtocol.read_packet")
|
@patch("stcgal.protocols.StcBaseProtocol.read_packet")
|
||||||
@patch("stcgal.protocols.Stc89Protocol.write_packet")
|
@patch("stcgal.protocols.Stc89Protocol.write_packet")
|
||||||
@ -75,7 +75,7 @@ class ProgramTests(unittest.TestCase):
|
|||||||
@patch("sys.stdout")
|
@patch("sys.stdout")
|
||||||
def test_program_stc12a(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
def test_program_stc12a(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
||||||
"""Test a programming cycle with STC12A protocol"""
|
"""Test a programming cycle with STC12A protocol"""
|
||||||
self._program_yml("./test/stc12c2052ad.yml", serial_mock, read_mock)
|
self._program_yml("./tests/stc12c2052ad.yml", serial_mock, read_mock)
|
||||||
|
|
||||||
def test_program_stc12b(self):
|
def test_program_stc12b(self):
|
||||||
"""Test a programming cycle with STC12B protocol"""
|
"""Test a programming cycle with STC12B protocol"""
|
||||||
@ -88,7 +88,7 @@ class ProgramTests(unittest.TestCase):
|
|||||||
@patch("sys.stdout")
|
@patch("sys.stdout")
|
||||||
def test_program_stc15f2(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
def test_program_stc15f2(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
||||||
"""Test a programming cycle with STC15 protocol, F2 series"""
|
"""Test a programming cycle with STC15 protocol, F2 series"""
|
||||||
self._program_yml("./test/iap15f2k61s2.yml", serial_mock, read_mock)
|
self._program_yml("./tests/iap15f2k61s2.yml", serial_mock, read_mock)
|
||||||
|
|
||||||
@patch("stcgal.protocols.StcBaseProtocol.read_packet")
|
@patch("stcgal.protocols.StcBaseProtocol.read_packet")
|
||||||
@patch("stcgal.protocols.Stc89Protocol.write_packet")
|
@patch("stcgal.protocols.Stc89Protocol.write_packet")
|
||||||
@ -97,7 +97,7 @@ class ProgramTests(unittest.TestCase):
|
|||||||
@patch("sys.stdout")
|
@patch("sys.stdout")
|
||||||
def test_program_stc15w4(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
def test_program_stc15w4(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
||||||
"""Test a programming cycle with STC15 protocol, W4 series"""
|
"""Test a programming cycle with STC15 protocol, W4 series"""
|
||||||
self._program_yml("./test/stc15w4k56s4.yml", serial_mock, read_mock)
|
self._program_yml("./tests/stc15w4k56s4.yml", serial_mock, read_mock)
|
||||||
|
|
||||||
@unittest.skip("trace is broken")
|
@unittest.skip("trace is broken")
|
||||||
@patch("stcgal.protocols.StcBaseProtocol.read_packet")
|
@patch("stcgal.protocols.StcBaseProtocol.read_packet")
|
||||||
@ -107,7 +107,7 @@ class ProgramTests(unittest.TestCase):
|
|||||||
@patch("sys.stdout")
|
@patch("sys.stdout")
|
||||||
def test_program_stc15a(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
def test_program_stc15a(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
||||||
"""Test a programming cycle with STC15A protocol"""
|
"""Test a programming cycle with STC15A protocol"""
|
||||||
self._program_yml("./test/stc15f104e.yml", serial_mock, read_mock)
|
self._program_yml("./tests/stc15f104e.yml", serial_mock, read_mock)
|
||||||
|
|
||||||
@patch("stcgal.protocols.StcBaseProtocol.read_packet")
|
@patch("stcgal.protocols.StcBaseProtocol.read_packet")
|
||||||
@patch("stcgal.protocols.Stc89Protocol.write_packet")
|
@patch("stcgal.protocols.Stc89Protocol.write_packet")
|
||||||
@ -116,7 +116,7 @@ class ProgramTests(unittest.TestCase):
|
|||||||
@patch("sys.stdout")
|
@patch("sys.stdout")
|
||||||
def test_program_stc15l1(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
def test_program_stc15l1(self, out, sleep_mock, serial_mock, write_mock, read_mock):
|
||||||
"""Test a programming cycle with STC15 protocol, L1 series"""
|
"""Test a programming cycle with STC15 protocol, L1 series"""
|
||||||
self._program_yml("./test/stc15l104w.yml", serial_mock, read_mock)
|
self._program_yml("./tests/stc15l104w.yml", serial_mock, read_mock)
|
||||||
|
|
||||||
def test_program_stc15w4_usb(self):
|
def test_program_stc15w4_usb(self):
|
||||||
"""Test a programming cycle with STC15W4 USB protocol"""
|
"""Test a programming cycle with STC15W4 USB protocol"""
|
Loading…
Reference in New Issue
Block a user