示例#1
0
 def test_should_find_prefix_module(self):
     self.assertEqual(autoimport.find_module_for
                      ("ConfigParser.SafeConfigParser"),
                      "ConfigParser")
     self.assertEqual(autoimport.find_module_for
                      ("xml.etree.ElementTree.parse"),
                      "xml.etree.ElementTree")
示例#2
0
 def test_should_find_prefix_module(self):
     self.assertEqual(autoimport.find_module_for
                      ("json.dumps"),
                      "json")
     self.assertEqual(autoimport.find_module_for
                      ("xml.etree.ElementTree.parse"),
                      "xml.etree.ElementTree")
示例#3
0
 def test_should_return_none_for_bad_module(self):
     self.assertIsNone(autoimport.find_module_for("foo"))
     self.assertIsNone(autoimport.find_module_for("foo.bar"))
示例#4
0
 def test_should_find_prefix_module(self):
     self.assertEqual(autoimport.find_module_for("json.dumps"), "json")
     self.assertEqual(
         autoimport.find_module_for("xml.etree.ElementTree.parse"),
         "xml.etree.ElementTree")
示例#5
0
 def test_should_find_direct_module(self):
     self.assertEqual(autoimport.find_module_for("json"), "json")
     self.assertEqual(autoimport.find_module_for("xml.etree"), "xml.etree")
示例#6
0
 def test_should_return_none_for_bad_module(self):
     self.assertIsNone(autoimport.find_module_for("foo"))
     self.assertIsNone(autoimport.find_module_for("foo.bar"))
示例#7
0
 def test_should_find_direct_module(self):
     self.assertEqual(autoimport.find_module_for("ConfigParser"),
                      "ConfigParser")
     self.assertEqual(autoimport.find_module_for("xml.etree"),
                      "xml.etree")