cleaned up warnings
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
class Singleton(type):
|
||||
"""
|
||||
Singleton Metaclass.
|
||||
@@ -16,4 +14,3 @@ class Singleton(type):
|
||||
cls.__instance = type.__call__(cls, *args, **kwargs)
|
||||
|
||||
return cls.__instance
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
from unittest import TestCase
|
||||
|
||||
from pypatterns.creational_patterns import Singleton
|
||||
from tests.utils.dummy import dummy_class_factory
|
||||
from patterns.creational import Singleton
|
||||
|
||||
|
||||
class SingletonTestCase(TestCase):
|
||||
"""
|
||||
Unit testing class for the singleton design pattern.
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
Initialize testing data.
|
||||
@@ -48,4 +49,3 @@ class SingletonTestCase(TestCase):
|
||||
|
||||
self.assertNotEquals(id(dummy_class_one_instance_one), id(dummy_class_two_instance_one))
|
||||
self.assertNotEquals(id(dummy_class_one_instance_two), id(dummy_class_two_instance_two))
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
from unittest import TestCase
|
||||
from tests.utils.dummy import dummy_class_factory
|
||||
from abc import ABCMeta, ABC
|
||||
from unittest import TestCase
|
||||
|
||||
from tests.utils.dummy import dummy_class_factory
|
||||
|
||||
|
||||
class DummyClassTestCase(TestCase):
|
||||
"""
|
||||
Unit testing class for the DummyClass class.
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
Initialize testing data.
|
||||
@@ -113,7 +115,3 @@ class DummyClassTestCase(TestCase):
|
||||
base_class=ABC)
|
||||
|
||||
self.assertEquals(ABC, dummy_class.__base__)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ from types import MethodType
|
||||
|
||||
|
||||
def dummy_class_factory(attributes, functions, base_class=object, meta_class=type):
|
||||
|
||||
class DummyClass(base_class, metaclass=meta_class):
|
||||
"""
|
||||
Class representing dummy data.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user