Skip to content

Commit

Permalink
Re-use FilesSpec from _path.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Apr 13, 2023
1 parent 5ff3f3b commit b0cce8a
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import contextlib

from .py39compat import FS_NONASCII
from typing import Dict, Union

from . import _path
from ._path import FilesSpec


try:
Expand Down Expand Up @@ -85,15 +85,8 @@ def setUp(self):
self.fixtures.enter_context(self.add_sys_path(self.site_dir))


# Except for python/mypy#731, prefer to define
# FilesDef = Dict[str, Union['FilesDef', str, bytes]]
FilesDef = Dict[
str, Union[Dict[str, Union[Dict[str, Union[str, bytes]], str, bytes]], str, bytes]
]


class DistInfoPkg(OnSysPath, SiteDir):
files: FilesDef = {
files: FilesSpec = {
"distinfo_pkg-1.0.0.dist-info": {
"METADATA": """
Name: distinfo-pkg
Expand Down Expand Up @@ -135,7 +128,7 @@ def make_uppercase(self):


class DistInfoPkgWithDot(OnSysPath, SiteDir):
files: FilesDef = {
files: FilesSpec = {
"pkg_dot-1.0.0.dist-info": {
"METADATA": """
Name: pkg.dot
Expand All @@ -150,7 +143,7 @@ def setUp(self):


class DistInfoPkgWithDotLegacy(OnSysPath, SiteDir):
files: FilesDef = {
files: FilesSpec = {
"pkg.dot-1.0.0.dist-info": {
"METADATA": """
Name: pkg.dot
Expand All @@ -177,7 +170,7 @@ def setUp(self):


class EggInfoPkg(OnSysPath, SiteDir):
files: FilesDef = {
files: FilesSpec = {
"egginfo_pkg.egg-info": {
"PKG-INFO": """
Name: egginfo-pkg
Expand Down Expand Up @@ -217,7 +210,7 @@ def setUp(self):


class EggInfoPkgPipInstalledNoToplevel(OnSysPath, SiteDir):
files: FilesDef = {
files: FilesSpec = {
"egg_with_module_pkg.egg-info": {
"PKG-INFO": "Name: egg_with_module-pkg",
# SOURCES.txt is made from the source archive, and contains files
Expand Down Expand Up @@ -252,7 +245,7 @@ def setUp(self):


class EggInfoPkgPipInstalledNoModules(OnSysPath, SiteDir):
files: FilesDef = {
files: FilesSpec = {
"egg_with_no_modules_pkg.egg-info": {
"PKG-INFO": "Name: egg_with_no_modules-pkg",
# SOURCES.txt is made from the source archive, and contains files
Expand Down Expand Up @@ -282,7 +275,7 @@ def setUp(self):


class EggInfoPkgSourcesFallback(OnSysPath, SiteDir):
files: FilesDef = {
files: FilesSpec = {
"sources_fallback_pkg.egg-info": {
"PKG-INFO": "Name: sources_fallback-pkg",
# SOURCES.txt is made from the source archive, and contains files
Expand All @@ -308,7 +301,7 @@ def setUp(self):


class EggInfoFile(OnSysPath, SiteDir):
files: FilesDef = {
files: FilesSpec = {
"egginfo_file.egg-info": """
Metadata-Version: 1.0
Name: egginfo_file
Expand Down

0 comments on commit b0cce8a

Please sign in to comment.