import StringIO
from unittest import TestCase

# custom modules
from iago.DatabaseProvider import DB


class TestDB(TestCase):
	def test_read_empty(self):
		s = StringIO.StringIO('{}')
		d = DB()
		try:
			d.read(s)
		except KeyError:
			self.fail('DB cannot handle empty JSON files.')

import StringIO
from unittest import TestCase

# custom modules
from iago.DatabaseProvider import DB


class TestDB(TestCase):
	def test_read_empty(self):
		s = StringIO.StringIO('{}')
		d = DB()
		try:
			d.read(s, format='json')
		except KeyError:
			self.fail('DB cannot handle empty JSON files.')

Fix test to specify file format
Fix test to specify file format

  import StringIO
  from unittest import TestCase
  
  # custom modules
  from iago.DatabaseProvider import DB
  
  
  class TestDB(TestCase):
  	def test_read_empty(self):
  		s = StringIO.StringIO('{}')
  		d = DB()
  		try:
- 			d.read(s)
+ 			d.read(s, format='json')
  		except KeyError:
  			self.fail('DB cannot handle empty JSON files.')
  
Fix test to specify file format
## Code Before:
import StringIO
from unittest import TestCase

# custom modules
from iago.DatabaseProvider import DB


class TestDB(TestCase):
	def test_read_empty(self):
		s = StringIO.StringIO('{}')
		d = DB()
		try:
			d.read(s)
		except KeyError:
			self.fail('DB cannot handle empty JSON files.')

## Instruction:
Fix test to specify file format
## Code After:
import StringIO
from unittest import TestCase

# custom modules
from iago.DatabaseProvider import DB


class TestDB(TestCase):
	def test_read_empty(self):
		s = StringIO.StringIO('{}')
		d = DB()
		try:
			d.read(s, format='json')
		except KeyError:
			self.fail('DB cannot handle empty JSON files.')
