Ejemplo n.º 1
0
 def test_simple(self):
     # Import some stdlib module that has not been imported before
     module_name = 'colorsys'
     if module_name in sys.modules:
         # May have been imported during test discovery, remove it again
         del sys.modules[module_name]
     assert module_name not in sys.modules
     colorsys = LazyModule(module_name)
     hsv = colorsys.rgb_to_hsv(.3, .4, .2)
     self.assertEqual(hsv[0], 0.25)
Ejemplo n.º 2
0
 def test_simple(self):
     # Import some stdlib module that has not been imported before
     module_name = 'colorsys'
     if module_name in sys.modules:
         # May have been imported during test discovery, remove it again
         del sys.modules[module_name]
     assert module_name not in sys.modules
     colorsys = LazyModule(module_name)
     hsv = colorsys.rgb_to_hsv(.3, .4, .2)
     self.assertEqual(hsv[0], 0.25)
Ejemplo n.º 3
0
 def test_simple(self):
     # Import some stdlib module that has not been imported before
     self.assertNotIn("colorsys", sys.modules)
     colorsys = LazyModule("colorsys")
     hsv = colorsys.rgb_to_hsv(.3, .4, .2)
     self.assertEqual(hsv[0], 0.25)