Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All files in providers package have unit tests #10799

Merged
merged 1 commit into from
Sep 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions tests/test_project_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@
import mmap
import os
import unittest
from typing import Set

from parameterized import parameterized

ROOT_FOLDER = os.path.realpath(
os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)
)

MISSING_TEST_FILES: Set[str] = set() # add missing test files in providers package here.


class TestProjectStructure(unittest.TestCase):
def test_reference_to_providers_from_core(self):
Expand Down Expand Up @@ -88,22 +85,7 @@ def test_providers_modules_should_have_tests(self):
current_test_files = set(current_test_files)

missing_tests_files = expected_test_files - expected_test_files.intersection(current_test_files)
self.assertEqual(set(), missing_tests_files - MISSING_TEST_FILES)

def test_keep_missing_test_files_update(self):
new_test_files = []
for test_file in MISSING_TEST_FILES:
if os.path.isfile(f"{ROOT_FOLDER}/{test_file}"):
new_test_files.append(test_file)
if new_test_files:
new_files_text = '\n'.join(new_test_files)
self.fail(
"You've added a test file currently listed as missing:\n"
f"{new_files_text}"
"\n"
"Thank you very much.\n"
"Can you remove it from the list of missing tests, please?"
)
self.assertEqual(set(), missing_tests_files)


class TestGoogleProviderProjectStructure(unittest.TestCase):
Expand Down