from nose import tools as nose
import unittest

from shiva.app import app
from shiva.indexer import Indexer


class IndexerTestCase(unittest.TestCase):

    def test_main(self):
        with app.app_context():
            lola = Indexer(app.config)
            nose.eq_(lola.run(), None)

from nose import tools as nose
import unittest

from shiva.app import app, db
from shiva.indexer import Indexer


class IndexerTestCase(unittest.TestCase):

    def setUp(self):
        db.create_all()

    def test_main(self):
        with app.app_context():
            app.config['MEDIA_DIRS'] = []
            lola = Indexer(app.config)
            nose.eq_(lola.run(), None)

    def tearDown(self):
        db.drop_all()

Fix to indexer integration tests
Fix to indexer integration tests

  from nose import tools as nose
  import unittest
  
- from shiva.app import app
+ from shiva.app import app, db
  from shiva.indexer import Indexer
  
  
  class IndexerTestCase(unittest.TestCase):
  
+     def setUp(self):
+         db.create_all()
+ 
      def test_main(self):
          with app.app_context():
+             app.config['MEDIA_DIRS'] = []
              lola = Indexer(app.config)
              nose.eq_(lola.run(), None)
  
+     def tearDown(self):
+         db.drop_all()
+ 
Fix to indexer integration tests
## Code Before:
from nose import tools as nose
import unittest

from shiva.app import app
from shiva.indexer import Indexer


class IndexerTestCase(unittest.TestCase):

    def test_main(self):
        with app.app_context():
            lola = Indexer(app.config)
            nose.eq_(lola.run(), None)

## Instruction:
Fix to indexer integration tests
## Code After:
from nose import tools as nose
import unittest

from shiva.app import app, db
from shiva.indexer import Indexer


class IndexerTestCase(unittest.TestCase):

    def setUp(self):
        db.create_all()

    def test_main(self):
        with app.app_context():
            app.config['MEDIA_DIRS'] = []
            lola = Indexer(app.config)
            nose.eq_(lola.run(), None)

    def tearDown(self):
        db.drop_all()
