Skip to content

Commit

Permalink
Setup tests with v2 module
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaOndieki committed Jun 29, 2018
1 parent ddcf21a commit 3317ab3
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 27 deletions.
27 changes: 27 additions & 0 deletions ridemyway/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
BASE testing module
"""

import unittest
from ridemyway import create_app


class BaseTest(unittest.TestCase):
"""
Base class for testing
"""
def setUp(self):
"""
Set up tests
"""
self.app = create_app(config_name='testing')
self.client = self.app.test_client
self.headers = {'content-type': 'application/json'}
self.context = self.app.app_context()
self.context.push()

def tearDown(self):
"""
Teardown all test files and instances created
"""
self.context.pop()
24 changes: 0 additions & 24 deletions ridemyway/tests/tests_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@
BASE testing module
"""

import unittest
from ridemyway import create_app


class BaseTest(unittest.TestCase):
"""
Base class for testing
"""
def setUp(self):
"""
Set up tests
"""
self.app = create_app(config_name='testing')
self.client = self.app.test_client
self.headers = {'content-type': 'application/json'}
self.context = self.app.app_context()
self.context.push()

def tearDown(self):
"""
Teardown all test files and instances created
"""
self.context.pop()


# TEST DATA
VALID_RIDE_DATASET = {
Expand Down
2 changes: 1 addition & 1 deletion ridemyway/tests/tests_v1/test_create_ride.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest
import json

from . import BaseTest
from ridemyway.tests import BaseTest
from . import (VALID_RIDE_DATASET,
INVALID_DATE_DATASET,
PAST_DATE_DATASET,
Expand Down
2 changes: 1 addition & 1 deletion ridemyway/tests/tests_v1/test_fetch_rides.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import json
import unittest

from . import BaseTest
from ridemyway.tests import BaseTest
from . import VALID_RIDE_DATASET, VALID_RIDE_DATASET_1


Expand Down
2 changes: 1 addition & 1 deletion ridemyway/tests/tests_v1/test_ride_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest
import json

from . import BaseTest
from ridemyway.tests import BaseTest
from . import VALID_RIDE_DATASET, VALID_RIDE_DATASET_1


Expand Down
21 changes: 21 additions & 0 deletions ridemyway/tests/tests_v2/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
BASE testing module
"""
from ridemyway.tests import BaseTest


class BaseTest(BaseTest):
"""
Base class for testing
"""
def setUp(self):
"""
Set up tests
"""
super().setUp()

def tearDown(self):
"""
Teardown all test files and instances created
"""
super().tearDown()
1 change: 1 addition & 0 deletions ridemyway/tests/tests_v2/test_auth.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from ridemyway.tests import BaseTest

0 comments on commit 3317ab3

Please sign in to comment.