예제 #1
0
 def test_import_submodule_as_source_name(self):
     binding = Importation('a', None, 'a.b')
     assert binding.source_statement == 'import a.b as a'
     assert str(binding) == 'a.b as a'
예제 #2
0
 def test_import_as(self):
     binding = Importation('c', None, 'a')
     assert binding.source_statement == 'import a as c'
     assert str(binding) == 'a as c'
예제 #3
0
 def test_import_submodule_as(self):
     # A submodule import with an as clause is not a SubmoduleImportation
     binding = Importation('c', None, 'a.b')
     assert binding.source_statement == 'import a.b as c'
     assert str(binding) == 'a.b as c'
예제 #4
0
 def test_import_basic(self):
     binding = Importation('a', None, 'a')
     assert binding.source_statement == 'import a'
     assert str(binding) == 'a'
예제 #5
0
 def test_import_submodule_as_source_name(self):
     binding = Importation("a", None, "a.b")
     assert binding.source_statement == "import a.b as a"
     assert str(binding) == "a.b as a"
예제 #6
0
 def test_import_submodule_as(self):
     # A submodule import with an as clause is not a SubmoduleImportation
     binding = Importation("c", None, "a.b")
     assert binding.source_statement == "import a.b as c"
     assert str(binding) == "a.b as c"
예제 #7
0
 def test_import_as(self):
     binding = Importation("c", None, "a")
     assert binding.source_statement == "import a as c"
     assert str(binding) == "a as c"
예제 #8
0
 def test_import_basic(self):
     binding = Importation("a", None, "a")
     assert binding.source_statement == "import a"
     assert str(binding) == "a"