Skip to content

Commit

Permalink
Simplify test directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
gunthercox committed Nov 10, 2018
1 parent 62c9ea5 commit 29150fe
Show file tree
Hide file tree
Showing 53 changed files with 21 additions and 45 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
from chatterbot.conversation import Statement
from chatterbot.input import Gitter
from tests.api_tests.test_gitter import GitterTestCase
from tests.api.test_gitter import GitterTestCase


class GitterAdapterTests(GitterTestCase):
Expand Down
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
from chatterbot.conversation import Statement
from chatterbot.input import Microsoft
from tests.api_tests.test_microsoft import MicrosoftTestCase
from tests.api.test_microsoft import MicrosoftTestCase


class MicrosoftInputAdapterTests(MicrosoftTestCase):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
from chatterbot.conversation import Statement
from chatterbot.output import Gitter
from tests.api_tests.test_gitter import GitterTestCase
from tests.api.test_gitter import GitterTestCase


class GitterAdapterTestCase(GitterTestCase):
Expand Down
File renamed without changes.
@@ -1,6 +1,6 @@
from chatterbot.conversation import Statement
from chatterbot.output import Microsoft
from tests.api_tests.test_microsoft import MicrosoftTestCase
from tests.api.test_microsoft import MicrosoftTestCase


class MicrosoftAdapterTests(MicrosoftTestCase):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -5,26 +5,37 @@

class MongoAdapterTestCase(TestCase):

def setUp(self):
@classmethod
def setUpClass(cls):
"""
Instantiate the adapter.
Instantiate the adapter before any tests in the test case run.
"""
from pymongo.errors import ServerSelectionTimeoutError
from pymongo import MongoClient

# Skip these tests if a mongo client is not running
cls.has_mongo_connection = False

try:
client = MongoClient(
serverSelectionTimeoutMS=0.1
)
client.server_info()

self.adapter = MongoDatabaseAdapter(
database_uri="mongodb://localhost:27017/chatterbot_test_database"
cls.adapter = MongoDatabaseAdapter(
database_uri='mongodb://localhost:27017/chatterbot_test_database'
)

cls.has_mongo_connection = False

except ServerSelectionTimeoutError:
self.skipTest("Unable to connect to mongo database.")
pass

def setUp(self):
"""
Skip these tests if a mongo client is not running.
"""
if not self.has_mongo_connection:
self.skipTest('Unable to connect to mongo database.')

def tearDown(self):
"""
Expand Down
File renamed without changes.
File renamed without changes.
Empty file.

This file was deleted.

This file was deleted.

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from unittest import TestCase
from chatterbot.conversation import Statement

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file removed tests/training_tests/__init__.py
Empty file.
Empty file.
File renamed without changes.

0 comments on commit 29150fe

Please sign in to comment.