rename all test files so that they are prefixed by test_{orginal_filename}.py

This commit is contained in:
Bastien Gérard
2019-08-28 16:01:44 +03:00
parent 99a58d5c91
commit ddececbfea
21 changed files with 90 additions and 155 deletions

View File

@@ -1,6 +0,0 @@
from .transform import *
from .field_list import *
from .queryset import *
from .visitor import *
from .geo import *
from .modify import *

View File

@@ -3,10 +3,8 @@ import unittest
from mongoengine import *
from mongoengine.queryset import QueryFieldList
__all__ = ("QueryFieldListTest", "OnlyExcludeAllTest")
class QueryFieldListTest(unittest.TestCase):
class TestQueryFieldList(unittest.TestCase):
def test_empty(self):
q = QueryFieldList()
self.assertFalse(q)
@@ -66,7 +64,7 @@ class QueryFieldListTest(unittest.TestCase):
self.assertEqual(q.as_dict(), {"a": {"$slice": 5}})
class OnlyExcludeAllTest(unittest.TestCase):
class TestOnlyExcludeAll(unittest.TestCase):
def setUp(self):
connect(db="mongoenginetest")

View File

@@ -6,10 +6,7 @@ from mongoengine import *
from tests.utils import MongoDBTestCase
__all__ = ("GeoQueriesTest",)
class GeoQueriesTest(MongoDBTestCase):
class TestGeoQueries(MongoDBTestCase):
def _create_event_data(self, point_field_class=GeoPointField):
"""Create some sample data re-used in many of the tests below."""

View File

@@ -41,7 +41,7 @@ def get_key_compat(mongo_ver):
return ORDER_BY_KEY, CMD_QUERY_KEY
class QuerySetTest(unittest.TestCase):
class TestQueryset(unittest.TestCase):
def setUp(self):
connect(db="mongoenginetest")
connect(db="mongoenginetest2", alias="test2")