* pyupgrade
* various new codemods
* manual removal of Py2/3 compat imports
* manual adjustment of docs, examples, tests
* to_str is now the new to_unicode, deprecated
redirection to to_bytes has been removed
* to_native_str has been redirected to point to
to_str
* to_unicode has been redirected to point to
to_str
* atomic_write refactored to use
NamedTemporaryDirectory
* various other fixes/refactorings all over the
place
30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
import unittest
|
|
|
|
import ddt
|
|
|
|
import octoprint_setuptools
|
|
|
|
|
|
@ddt.ddt
|
|
class OctoPrintSetuptoolsTest(unittest.TestCase):
|
|
@ddt.data(
|
|
("OctoPrint", ["OctoPrint", "flask"], True),
|
|
("OctoPrint", ["OctoPrint<1.3.7", "flask"], True),
|
|
("OctoPrint", ["OctoPrint<=1.3.7", "flask"], True),
|
|
("OctoPrint", ["OctoPrint==1.3.7", "flask"], True),
|
|
("OctoPrint", ["OctoPrint!=1.3.7", "flask"], True),
|
|
("OctoPrint", ["OctoPrint>=1.3.7", "flask"], True),
|
|
("OctoPrint", ["OctoPrint>1.3.7", "flask"], True),
|
|
("OctoPrint", ["OctoPrint~=1.3.7", "flask"], True),
|
|
("OctoPrint", ["OctoPrint===1.3.7", "flask"], True),
|
|
("OctoPrint", ["oCTOpRINT>=1.3.7", "flask"], True),
|
|
("OctoPrint", ["flask"], False),
|
|
("OctoPrint", [], False),
|
|
("OctoPrint", None, False),
|
|
(None, [], False),
|
|
)
|
|
@ddt.unpack
|
|
def test_has_requirement(self, requirement, requirements, expected):
|
|
actual = octoprint_setuptools.has_requirement(requirement, requirements)
|
|
self.assertEqual(actual, expected)
|