Esempio n. 1
0
 def setUp(self):
     self.return_value = [
         _AttrMapping('dname', 'os.path', 'dirname',
                      'os.path:dirname,dname'),
         _AttrMapping(
             'basename',
             'os.path',
             'basename',
             'os.path:basename',
         )
     ]
     self.attr_map = tuple([x.item for x in self.return_value])
     patcher = patch('flutils.moduleutils._expand_attr_map',
                     return_value=self.return_value)
     self._expand_attr_map = patcher.start()
     self.addCleanup(patcher.stop)
 def setUp(self):
     self.item = 'os.path:dirname,dname'
     self.return_value = _AttrMapping('dname', 'os.path', 'dirname',
                                      self.item)
     patcher = patch('flutils.moduleutils._expand_attr_map_item',
                     return_value=self.return_value)
     self._expand_foreign_name = patcher.start()
     self.addCleanup(patcher.stop)
 def test_integration_expand_attr_map_item_module_attr_alias(self):
     item = 'os.path:dirname,dname'
     expect = _AttrMapping('dname', 'os.path', 'dirname', item)
     val = list(map(_expand_attr_map_item, (item, )))
     self.assertEqual(val, [expect])
 def test_integration_expand_attr_map_item_sub_module_alias(self):
     item = 'os.path,_path'
     expect = _AttrMapping('_path', 'os.path', '', item)
     val = list(map(_expand_attr_map_item, (item, )))
     self.assertEqual(val, [expect])
    def test_integration_expand_attr_map_item_alias(self):
        item = 'os, _os'
        expect = _AttrMapping('_os', 'os', '', item)

        val = list(map(_expand_attr_map_item, (item, )))
        self.assertEqual(val, [expect])