Snippet for "Why Refactoring? How to Refactor/Restructure Python Package?" https://hackernoon.com/why-refactoring-how-to-restructure-python-package-51b89aa91987
This file contains 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
""" | |
Package: utils.tests | |
Faulty Test Cases | |
""" | |
import unittest | |
class UtilsTestCase(unittest.TestCase): | |
def setUp(self): | |
pass | |
def test_is_empty(self): | |
from utils.common.helpers import is_empty | |
# Problem: there is no assertion | |
is_empty('') | |
is_empty(None) | |
is_empty('', object_type='json') | |
is_empty('{}', object_type='json') | |
def test_is_ok(self): | |
# Problem: this is empty. | |
pass | |
def test_is_number(self): | |
# Problem: this will pass. | |
if not is_empty(''): | |
print('Fail') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment