FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-44771: rename namespacedata01 to namespacedata by FFY00 · Pull Request #27484 · python/cpython · GitHub

Repository navigation

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .file  (3) .in  (1) .py  (6) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions Lib/test/test_importlib/test_contents.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ class ContentsNamespaceTests(ContentsTests, unittest.TestCase):
}

def setUp(self):
from . import namespacedata01
from . import namespacedata

self.data = namespacedata01
self.data = namespacedata
4 changes: 2 additions & 2 deletions Lib/test/test_importlib/test_files.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class OpenZipTests(FilesTests, util.ZipSetup, unittest.TestCase):

class OpenNamespaceTests(FilesTests, unittest.TestCase):
def setUp(self):
from . import namespacedata01
from . import namespacedata

self.data = namespacedata01
self.data = namespacedata


if __name__ == '__main__':
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_importlib/test_open.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def setUp(self):

class OpenDiskNamespaceTests(OpenTests, unittest.TestCase):
def setUp(self):
from . import namespacedata01
from . import namespacedata

self.data = namespacedata01
self.data = namespacedata


class OpenZipTests(OpenTests, util.ZipSetup, unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_importlib/test_read.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def test_read_submodule_resource_by_name(self):

class ReadNamespaceTests(ReadTests, unittest.TestCase):
def setUp(self):
from . import namespacedata01
from . import namespacedata

self.data = namespacedata01
self.data = namespacedata


if __name__ == '__main__':
Expand Down
18 changes: 9 additions & 9 deletions Lib/test/test_importlib/test_reader.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class MultiplexedPathTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
path = pathlib.Path(__file__).parent / 'namespacedata01'
path = pathlib.Path(__file__).parent / 'namespacedata'
cls.folder = str(path)

def test_init_no_paths(self):
Expand Down Expand Up @@ -65,15 +65,15 @@ def test_join_path(self):
path = MultiplexedPath(self.folder, data01)
self.assertEqual(
str(path.joinpath('binary.file'))[len(prefix) + 1 :],
os.path.join('namespacedata01', 'binary.file'),
os.path.join('namespacedata', 'binary.file'),
)
self.assertEqual(
str(path.joinpath('subdirectory'))[len(prefix) + 1 :],
os.path.join('data01', 'subdirectory'),
)
self.assertEqual(
str(path.joinpath('imaginary'))[len(prefix) + 1 :],
os.path.join('namespacedata01', 'imaginary'),
os.path.join('namespacedata', 'imaginary'),
)

def test_repr(self):
Expand Down Expand Up @@ -105,10 +105,10 @@ def test_init_error(self):
NamespaceReader(['path1', 'path2'])

def test_resource_path(self):
namespacedata01 = import_module('namespacedata01')
reader = NamespaceReader(namespacedata01.__spec__.submodule_search_locations)
namespacedata = import_module('namespacedata')
reader = NamespaceReader(namespacedata.__spec__.submodule_search_locations)

root = os.path.abspath(os.path.join(__file__, '..', 'namespacedata01'))
root = os.path.abspath(os.path.join(__file__, '..', 'namespacedata'))
self.assertEqual(
reader.resource_path('binary.file'), os.path.join(root, 'binary.file')
)
Expand All @@ -117,9 +117,9 @@ def test_resource_path(self):
)

def test_files(self):
namespacedata01 = import_module('namespacedata01')
reader = NamespaceReader(namespacedata01.__spec__.submodule_search_locations)
root = os.path.abspath(os.path.join(__file__, '..', 'namespacedata01'))
namespacedata = import_module('namespacedata')
reader = NamespaceReader(namespacedata.__spec__.submodule_search_locations)
root = os.path.abspath(os.path.join(__file__, '..', 'namespacedata'))
self.assertIsInstance(reader.files(), MultiplexedPath)
self.assertEqual(repr(reader.files()), f"MultiplexedPath('{root}')")

Expand Down
8 changes: 4 additions & 4 deletions Lib/test/test_importlib/test_resource.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -227,22 +227,22 @@ def tearDownClass(cls):

def test_is_submodule_resource(self):
self.assertTrue(
resources.is_resource(import_module('namespacedata01'), 'binary.file')
resources.is_resource(import_module('namespacedata'), 'binary.file')
)

def test_read_submodule_resource_by_name(self):
self.assertTrue(resources.is_resource('namespacedata01', 'binary.file'))
self.assertTrue(resources.is_resource('namespacedata', 'binary.file'))

def test_submodule_contents(self):
contents = set(resources.contents(import_module('namespacedata01')))
contents = set(resources.contents(import_module('namespacedata')))
try:
contents.remove('__pycache__')
except KeyError:
pass
self.assertEqual(contents, {'binary.file', 'utf-8.file', 'utf-16.file'})

def test_submodule_contents_by_name(self):
contents = set(resources.contents('namespacedata01'))
contents = set(resources.contents('namespacedata'))
try:
contents.remove('__pycache__')
except KeyError:
Expand Down
2 changes: 1 addition & 1 deletion Makefile.pre.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ TESTSUBDIRS= ctypes/test \
test/test_importlib/namespace_pkgs/project3 \
test/test_importlib/namespace_pkgs/project3/parent \
test/test_importlib/namespace_pkgs/project3/parent/child \
test/test_importlib/namespacedata01 \
test/test_importlib/namespacedata \
test/test_importlib/partial \
test/test_importlib/source \
test/test_importlib/zipdata01 \
Expand Down

Back | FazBrowse Home | New Git URL