5 from modulegraph
import modulegraph
7 class DummyModule(object):
9 def __init__(self
, ppath
):
10 self
.packagepath
= ppath
12 class FindAllSubmodulesTestCase(unittest
.TestCase
):
14 mg
= modulegraph
.ModuleGraph()
18 for sm
in mg
._find
_all
_submodules
(m
):
20 self
.assertEqual(sub_ms
, [])
23 mg
= modulegraph
.ModuleGraph()
24 # a string does not break anything although it is split into its characters
25 # BUG: "/hi/there" will read "/"
26 m
= DummyModule("xyz")
28 for sm
in mg
._find
_all
_submodules
(m
):
30 self
.assertEqual(sub_ms
, [])
32 def testSlashes(self
):
33 # a string does not break anything although it is split into its characters
34 # BUG: "/xyz" will read "/" so this one already triggers missing itertools
35 mg
= modulegraph
.ModuleGraph()
36 m
= DummyModule("/xyz")
38 for sm
in mg
._find
_all
_submodules
(m
):
40 self
.assertEqual(sub_ms
, [])
42 if __name__
== '__main__':