Skip to content
This repository has been archived by the owner on Mar 20, 2020. It is now read-only.

Commit

Permalink
#23 Use Django test runner which creates a temporary database.
Browse files Browse the repository at this point in the history
  • Loading branch information
josiahseaman committed Aug 15, 2019
1 parent 650736e commit d94bb94
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Graph/test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import unittest
from django.test import TestCase
import os
from os.path import join
from Graph.gfa import GFA
from Graph.models import Graph, Slice, Node, Path#, SlicedGraph
from Graph.models import Slice, Node, GraphGenome, Path
from Graph.sort import DAGify

# Define the working directory
Expand All @@ -19,7 +20,9 @@


a, b, c, d, e = 'a', 'b', 'c', 'd', 'e' # Paths must be created first
class GraphTest(unittest.TestCase):


class GraphTest(TestCase):
"""Constructing a node with an existing Path object will modify that Path object (doubly linked)
which means care must be taken when constructing Graphs. From factory_input we have an example of
pure python to Graph.build in one step. In example_graph, we must first declare the Paths,
Expand Down Expand Up @@ -86,9 +89,12 @@ def test_equalities(self):

x,y,z,a = 'x', 'y', 'z', 'a'

class DAGifyTest(unittest.TestCase):
class DAGifyTest(TestCase):
""" test class of sort.py
"""
# def tearDown(self) -> None:
# # Cascade delete all test DB entries
# GraphGenome.objects.get_queryset(name__contains=os.path.join(PATH_TO_TEST_DATA)).delete()

def test_dagify(self):
gfa = GFA.load_from_gfa(join(PATH_TO_TEST_DATA, "test.gfa"))
Expand Down Expand Up @@ -176,7 +182,7 @@ def test_simple_inversion(self):



class GFATest(unittest.TestCase):
class GFATest(TestCase):
""" test class of gfa.py
"""

Expand Down

0 comments on commit d94bb94

Please sign in to comment.