Skip to content

Commit

Permalink
Added tests to increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Néstor Morales Hernández committed Apr 14, 2021
1 parent 6577774 commit f152366
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/feature/test_feature_python.py
Expand Up @@ -72,3 +72,29 @@ def test_on_start(self):

assert event.setup["name"] == PACKAGE_NAME
assert event.setup["python_requires"] == ">=3.5"

def test_on_end(self):
config = self.create_config()

feature, dispatcher = self.create_feature()
event = ProjectEvent(config=config, setup={"name": PACKAGE_NAME, "python_requires": ">=3.5"})
feature.on_end(event)

assert event.setup["name"] == PACKAGE_NAME
assert event.setup["python_requires"] == ">=3.5"
assert not event.config["python"].use_uniform_requirements
assert not event.config["python"].show_comes_from_info

def test_on_end_uniform_requirements(self):
config = self.create_config()
config["python"].use_uniform_requirements = True
config["python"].show_comes_from_info = True

feature, dispatcher = self.create_feature()
event = ProjectEvent(config=config, setup={"name": PACKAGE_NAME, "python_requires": ">=3.5"})
feature.on_end(event)

assert event.setup["name"] == PACKAGE_NAME
assert event.setup["python_requires"] == ">=3.5"
assert event.config["python"].use_uniform_requirements
assert event.config["python"].show_comes_from_info

0 comments on commit f152366

Please sign in to comment.