mirror of
https://github.com/danieldemus/pyp2spec.git
synced 2026-07-29 13:44:21 +02:00
Use betamax cassettes to record & replay requests to PyPI
This commit is contained in:
File diff suppressed because one or more lines are too long
+10
-6
@@ -1,10 +1,14 @@
|
||||
# import config
|
||||
import pyp2conf
|
||||
|
||||
import betamax
|
||||
import tomli
|
||||
|
||||
import pyp2conf
|
||||
|
||||
def test_config_is_valid():
|
||||
|
||||
with betamax.Betamax.configure() as config:
|
||||
config.cassette_library_dir = 'tests/fixtures/cassettes'
|
||||
|
||||
|
||||
def test_config_is_valid(betamax_session):
|
||||
package = "aionotion"
|
||||
config = pyp2conf.create_config_contents(
|
||||
package=package,
|
||||
@@ -15,11 +19,11 @@ def test_config_is_valid():
|
||||
name="Package Manager",
|
||||
version="2.0.3",
|
||||
summary="Python library for Notion Home Monitoring",
|
||||
date="Fri Jun 04 2021"
|
||||
date="Fri Jun 04 2021",
|
||||
session=betamax_session,
|
||||
)
|
||||
|
||||
with open(f"tests/test_configs/pyp2spec_{package}.conf", "rb") as config_file:
|
||||
loaded_contents = tomli.load(config_file)
|
||||
|
||||
assert config == loaded_contents
|
||||
# assert config.ConfigFile.validate_contents(contents)
|
||||
|
||||
Reference in New Issue
Block a user